(self, arg)
show this help
show this help
show this help
def do_help(self, arg):
		""" show this help """
		if arg:
			try:
				func = getattr(self, 'help_' + arg)
			except AttributeError:
				try:
					doc=getattr(self, 'do_' + arg).__doc__
					if doc:
						self.stdout.write("%s\n"%str(doc))
						return
				except AttributeError:
					pass
				self.stdout.write("%s\n"%str(self.nohelp % (arg,)))
				return
			func()
		else:
			names = self.get_names()
			cmds_doc = []
			help = {}
			for name in names:
				if name[:5] == 'help_':
					help[name[5:]]=1
			names.sort()
			# There can be duplicates if routines overridden
			prevname = ''
			for name in names:
				if name[:3] == 'do_':
					if name == prevname:
						continue
					prevname = name
					cmd=name[3:]
					if cmd in help:
						cmds_doc.append(cmd)
						del help[cmd]
					elif getattr(self, name).__doc__:
						cmds_doc.append((cmd, getattr(self, name).__doc__))
					else:
						cmds_doc.append((cmd, ""))
			for name in [x for x in self.aliases.iterkeys()]:
				cmds_doc.append((name, self.pupsrv.get_module(self.aliases[name]).__doc__))

			self.stdout.write("%s\n"%str(self.doc_header))
			for command,doc in cmds_doc:
				self.stdout.write("- {:<10}	{}\n".format(command, color(doc,'grey')))
def do_help ( self , arg ) : if arg : try : func = getattr ( self , 'help_' + arg ) except AttributeError : try : doc = getattr ( self , 'do_' + arg ) . __doc__ if doc : self . stdout . write ( "%s\n" % str ( doc ) ) return except AttributeError : pass self . stdout . write ( "%s\n" % str ( self . nohelp % ( arg , ) ) ) return func ( ) else : names = self . get_names ( ) cmds_doc = [ ] help = { } for name in names : if name [ : 5 ] == 'help_' : help [ name [ 5 : ] ] = 1 names . sort ( ) # There can be duplicates if routines overridden prevname = '' for name in names : if name [ : 3 ] == 'do_' : if name == prevname : continue prevname = name cmd = name [ 3 : ] if cmd in help : cmds_doc . append ( cmd ) del help [ cmd ] elif getattr ( self , name ) . __doc__ : cmds_doc . append ( ( cmd , getattr ( self , name ) . __doc__ ) ) else : cmds_doc . append ( ( cmd , "" ) ) for name in [ x for x in self . aliases . iterkeys ( ) ] : cmds_doc . append ( ( name , self . pupsrv . get_module ( self . aliases [ name ] ) . __doc__ ) ) self . stdout . write ( "%s\n" % str ( self . doc_header ) ) for command , doc in cmds_doc : self . stdout . write ( "- {:<10}	{}\n" . format ( command , color ( doc , 'grey' ) ) )