loop to handle commands & possibly re-show window

This commit is contained in:
Josh Holtrop 2011-01-01 23:14:12 -05:00
parent 684834806e
commit e6d8d36aeb

13
dwtt
View File

@ -37,13 +37,20 @@ def main(argv):
ds = DataStore(timedbfile)
cmdline = doCmdWindow()
cmd = Command(cmdline)
print "Command:", cmd
while True:
cmdline = doCmdWindow()
cmd = Command(cmdline)
if not processCommand(cmd, ds):
break
def doCmdWindow():
c = CmdWindow()
return c.main()
# Returns boolean for whether the command prompt should be displayed again
def processCommand(cmd, store):
print cmd
return cmd.command == 'status'
if __name__ == "__main__":
main(sys.argv)