allowed command window to persist across commands

This commit is contained in:
Josh Holtrop committed 2011-01-03 14:55:44 -05:00
1 parent 7a10dd335a
commit 5fb84110e1
2 files changed
+70 -27

No files matched your search

+20 -9
View File
@@ -38,24 +38,35 @@ def main(argv):
ds = DataStore(timedbfile)
while True:
status = ''
starttime = None
def handleActivated(cmdline, cw):
if cmdline.strip() == '':
return False
ct = ds.getCurrentTask()
if ct is not None:
task = ds.getTaskByID(ct.taskid)
status = 'Task: ' + ds.getTaskPath(task)
if task.longname != '':
status += ' (%s)' % task.longname
starttime = ct.time
cw = CmdWindow(status, starttime)
cmdline = cw.main()
if cmdline.strip() == '':
break
cw.setStatus(status, ct.time)
else:
cw.setStatus('', None)
cmd = Command(cmdline)
res = processCommand(cmd, ds)
if not res.keepwindow:
break
return False
cw.setError(res.error)
cw.setFormatted(res.formatted)
return True
cw = CmdWindow(handleActivated)
ct = ds.getCurrentTask()
if ct is not None:
task = ds.getTaskByID(ct.taskid)
status = 'Task: ' + ds.getTaskPath(task)
if task.longname != '':
status += ' (%s)' % task.longname
cw.setStatus(status, ct.time)
cw.main()
class Result:
def __init__(self):