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) ds = DataStore(timedbfile)
cmdline = doCmdWindow() while True:
cmd = Command(cmdline) cmdline = doCmdWindow()
print "Command:", cmd cmd = Command(cmdline)
if not processCommand(cmd, ds):
break
def doCmdWindow(): def doCmdWindow():
c = CmdWindow() c = CmdWindow()
return c.main() 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__": if __name__ == "__main__":
main(sys.argv) main(sys.argv)