Subversion Repositories freemyipod

Rev

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

Rev 776 Rev 778
Line 1320... Line 1320...
1320
    def free_all(self):
1320
    def free_all(self):
1321
        """ Frees all memory allocations created by the monitor thread """
1321
        """ Frees all memory allocations created by the monitor thread """
1322
        self.logger.info("Freeing all memory allocations created by the monitor thread\n")
1322
        self.logger.info("Freeing all memory allocations created by the monitor thread\n")
1323
        self.emcore.free_all()
1323
        self.emcore.free_all()
1324
        self.logger.info("Successfully freed all memory allocations created by the monitor thread\n")
1324
        self.logger.info("Successfully freed all memory allocations created by the monitor thread\n")
-
 
1325
    
-
 
1326
    @command
-
 
1327
    def rtcread(self):
-
 
1328
        """ Reads the real time clock on the device """
-
 
1329
        import datetime
-
 
1330
        self.logger.info("Reading the clock\n")
-
 
1331
        dt = self.emcore.rtcread()
-
 
1332
        self.logger.info("Successfully read the clock: %s\n" % (dt.ctime()))
-
 
1333
            
-
 
1334
    @command
-
 
1335
    def rtcwrite(self):
-
 
1336
        """ Sets the real time clock on the device to the current local time """
-
 
1337
        import datetime
-
 
1338
        dt = datetime.datetime.now()
-
 
1339
        self.logger.info("Setting the clock to: %s\n" % (dt.ctime()))
-
 
1340
        self.emcore.rtcwrite(dt)
-
 
1341
        self.logger.info("Successfully set the clock\n")
1325
        
1342
        
1326
 
1343
 
1327
if __name__ == "__main__":
1344
if __name__ == "__main__":
1328
    if len(sys.argv) < 2:
1345
    if len(sys.argv) < 2:
1329
        usage("No command specified", docstring = False)
1346
        usage("No command specified", docstring = False)
1330
    try:
1347
    try:
1331
        interface = Commandline()
1348
        interface = Commandline()
1332
        interface._parsecommand(sys.argv[1], sys.argv[2:])
1349
        interface._parsecommand(sys.argv[1], sys.argv[2:])
1333
    except KeyboardInterrupt:
1350
    except KeyboardInterrupt:
1334
        sys.exit()
-
 
1335
1351
        sys.exit()
-
 
1352