Subversion Repositories freemyipod

Rev

Rev 442 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 442 Rev 444
Line 54... Line 54...
54
            return "Expected " + str(self.expected) + " but saw " + str(self.seen)
54
            return "Expected " + str(self.expected) + " but saw " + str(self.seen)
55
        else:
55
        else:
56
            return "Expected " + str(self.expected) + ", but saw something else"
56
            return "Expected " + str(self.expected) + ", but saw something else"
57
 
57
 
58
 
58
 
59
def usage(errormsg=None, specific=False):
59
def usage(errormsg=None, specific=False, docstring=True):
60
    """
60
    """
61
        Prints the usage information.
61
        Prints the usage information.
62
        It is auto generated from various places.
62
        It is auto generated from various places.
63
    """
63
    """
64
    logger = Logger()
64
    logger = Logger()
Line 78... Line 78...
78
            if doc[function]['kwargs']:
78
            if doc[function]['kwargs']:
79
                for kwarg, kwvalue in doc[function]['kwargs'].iteritems():
79
                for kwarg, kwvalue in doc[function]['kwargs'].iteritems():
80
                    logger.log("[" + kwarg + " = " + str(kwvalue) + "] ")
80
                    logger.log("[" + kwarg + " = " + str(kwvalue) + "] ")
81
            if doc[function]['varargs']:
81
            if doc[function]['varargs']:
82
                logger.log("<db1> ... <dbN>")
82
                logger.log("<db1> ... <dbN>")
83
            logger.log("\n")
83
            if docstring and doc[function]['documentation']:
84
            if doc[function]['documentation']:
84
                logger.log("\n")
85
                logger.log(doc[function]['documentation']+"\n", 4)
85
                logger.log(doc[function]['documentation']+"\n", 4)
86
            logger.log("\n")
86
            logger.log("\n")
87
    logger.log("\n")
87
    logger.log("\n")
88
 
88
 
89
    if errormsg:
89
    if errormsg:
Line 205... Line 205...
205
    @staticmethod
205
    @staticmethod
206
    def _hex(integer):
206
    def _hex(integer):
207
        return "0x%x" % integer
207
        return "0x%x" % integer
208
    
208
    
209
    @command
209
    @command
-
 
210
    def help(self):
-
 
211
        """ Generates a list of functions """
-
 
212
        usage(None, False, False)
-
 
213
    
-
 
214
    @command
210
    def getinfo(self, infotype):
215
    def getinfo(self, infotype):
211
        """
216
        """
212
            Get info on the running emCORE.
217
            Get info on the running emCORE.
213
            <infotype> may be either of 'version', 'packetsize', 'usermemrange'.
218
            <infotype> may be either of 'version', 'packetsize', 'usermemrange'.
214
        """
219
        """