loop to handle commands & possibly re-show window
This commit is contained in:
parent
684834806e
commit
e6d8d36aeb
13
dwtt
13
dwtt
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user