show full path to current task in command window

This commit is contained in:
Josh Holtrop 2011-01-03 12:57:24 -05:00
parent 6c2b6df94c
commit 8dac698ca2
2 changed files with 13 additions and 1 deletions

View File

@ -180,6 +180,15 @@ WHERE name = ?
parentname = ':'.join(parts[:-1])
return self.getTaskByShortName(parentname)
def getTaskPath(self, task):
path = task.name
if task.parentid is not None:
parenttask = self.getTaskByID(task.parentid)
if parenttask is not None:
parentpath = self.getTaskPath(parenttask)
path = parentpath + ' : ' + path
return path
def createTask(self, name, longname, parentid):
c = self.conn.cursor()
if parentid is not None and parentid != '':

5
dwtt
View File

@ -42,7 +42,10 @@ def main(argv):
starttime = None
ct = ds.getCurrentTask()
if ct is not None:
status = 'Current Task: ' + ds.getTaskByID(ct.taskid).name
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()