freemyipod r444 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r443‎ | r444 | r445 >
Date:18:12, 18 January 2011
Author:farthen
Status:new
Tags:
Comment:
emcore.py: implement "emcore.py help" command that displays a short form of the function list for quick reference
Modified paths:
  • /emcore/trunk/tools/emcore.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/emcore.py
@@ -56,7 +56,7 @@
5757 return "Expected " + str(self.expected) + ", but saw something else"
5858
5959
60 -def usage(errormsg=None, specific=False):
 60+def usage(errormsg=None, specific=False, docstring=True):
6161 """
6262 Prints the usage information.
6363 It is auto generated from various places.
@@ -80,8 +80,8 @@
8181 logger.log("[" + kwarg + " = " + str(kwvalue) + "] ")
8282 if doc[function]['varargs']:
8383 logger.log("<db1> ... <dbN>")
84 - logger.log("\n")
85 - if doc[function]['documentation']:
 84+ if docstring and doc[function]['documentation']:
 85+ logger.log("\n")
8686 logger.log(doc[function]['documentation']+"\n", 4)
8787 logger.log("\n")
8888 logger.log("\n")
@@ -207,6 +207,11 @@
208208 return "0x%x" % integer
209209
210210 @command
 211+ def help(self):
 212+ """ Generates a list of functions """
 213+ usage(None, False, False)
 214+
 215+ @command
211216 def getinfo(self, infotype):
212217 """
213218 Get info on the running emCORE.