Exemplo n.º 1
0
 def getItemTooltipData(self, task):
     if not self.settings.getboolean('view', 'descriptionpopups'):
         return []
     result = [(self.iconName(task, task in self.curselection()), 
                [self.getItemText(task)])]
     if task.description():
         result.append((None, map(lambda x: x.rstrip('\n'),
                              task.description().split('\n'))))
     if task.notes():
         result.append(('note_icon', sorted([note.subject() for note in task.notes()])))
     if task.attachments():
         result.append(('paperclip_icon',
             sorted([unicode(attachment) for attachment in task.attachments()])))
     return result
Exemplo n.º 2
0
 def taskNode(self, task):
     node = self.baseCompositeNode(task, 'task', self.taskNode)
     node.setAttribute('status', str(task.getStatus()))
     if task.startDate() != date.Date():
         node.setAttribute('startdate', str(task.startDate()))
     if task.dueDate() != date.Date():
         node.setAttribute('duedate', str(task.dueDate()))
     if task.completionDate() != date.Date():
         node.setAttribute('completiondate', str(task.completionDate()))
     if task.recurrence():
         node.appendChild(self.recurrenceNode(task.recurrence()))
     if task.budget() != date.TimeDelta():
         node.setAttribute('budget', self.budgetAsAttribute(task.budget()))
     if task.priority() != 0:
         node.setAttribute('priority', str(task.priority()))
     if task.hourlyFee() != 0:
         node.setAttribute('hourlyFee', str(task.hourlyFee()))
     if task.fixedFee() != 0:
         node.setAttribute('fixedFee', str(task.fixedFee()))
     if task.reminder() != None:
         node.setAttribute('reminder', str(task.reminder()))
     if task.shouldMarkCompletedWhenAllChildrenCompleted != None:
         node.setAttribute('shouldMarkCompletedWhenAllChildrenCompleted', 
                           str(task.shouldMarkCompletedWhenAllChildrenCompleted))
     for effort in task.efforts():
         node.appendChild(self.effortNode(effort))
     for note in task.notes():
         node.appendChild(self.noteNode(note))
     for attachment in task.attachments():
         node.appendChild(self.attachmentNode(attachment))
     return node
Exemplo n.º 3
0
 def taskNode(self, parentNode, task):  # pylint: disable=W0621
     maxDateTime = self.maxDateTime
     node = self.baseCompositeNode(parentNode, task, 'task', self.taskNode)
     node.attrib['status'] = str(task.getStatus())
     if task.plannedStartDateTime() != maxDateTime:
         node.attrib['plannedstartdate'] = str(task.plannedStartDateTime())
     if task.dueDateTime() != maxDateTime:
         node.attrib['duedate'] = str(task.dueDateTime())
     if task.actualStartDateTime() != maxDateTime:
         node.attrib['actualstartdate'] = str(task.actualStartDateTime())
     if task.completionDateTime() != maxDateTime:
         node.attrib['completiondate'] = str(task.completionDateTime())
     if task.percentageComplete():
         node.attrib['percentageComplete'] = str(task.percentageComplete())
     if task.recurrence():
         self.recurrenceNode(node, task.recurrence())
     if task.budget() != date.TimeDelta():
         node.attrib['budget'] = self.budgetAsAttribute(task.budget())
     if task.priority():
         node.attrib['priority'] = str(task.priority())
     if task.hourlyFee():
         node.attrib['hourlyFee'] = str(task.hourlyFee())
     if task.fixedFee():
         node.attrib['fixedFee'] = str(task.fixedFee())
     reminder = task.reminder() 
     if reminder != maxDateTime and reminder != None:
         node.attrib['reminder'] = str(reminder)
         reminderBeforeSnooze = task.reminder(includeSnooze=False)
         if reminderBeforeSnooze != None and reminderBeforeSnooze < task.reminder():
             node.attrib['reminderBeforeSnooze'] = str(reminderBeforeSnooze)
     prerequisiteIds = ' '.join([prerequisite.id() for prerequisite in \
         sortedById(task.prerequisites())])
     if prerequisiteIds:            
         node.attrib['prerequisites'] = prerequisiteIds
     if task.shouldMarkCompletedWhenAllChildrenCompleted() != None:
         node.attrib['shouldMarkCompletedWhenAllChildrenCompleted'] = \
                           str(task.shouldMarkCompletedWhenAllChildrenCompleted())
     for effort in sortedById(task.efforts()):
         self.effortNode(node, effort)
     for eachNote in sortedById(task.notes()):
         self.noteNode(node, eachNote)
     for attachment in sortedById(task.attachments()):
         self.attachmentNode(node, attachment)
     return node
Exemplo n.º 4
0
 def taskNode(self, parentNode, task):  # pylint: disable=W0621
     maxDateTime = self.maxDateTime
     node = self.baseCompositeNode(parentNode, task, 'task', self.taskNode)
     node.attrib['status'] = str(task.getStatus())
     if task.plannedStartDateTime() != maxDateTime:
         node.attrib['plannedstartdate'] = str(task.plannedStartDateTime())
     if task.dueDateTime() != maxDateTime:
         node.attrib['duedate'] = str(task.dueDateTime())
     if task.actualStartDateTime() != maxDateTime:
         node.attrib['actualstartdate'] = str(task.actualStartDateTime())
     if task.completionDateTime() != maxDateTime:
         node.attrib['completiondate'] = str(task.completionDateTime())
     if task.percentageComplete():
         node.attrib['percentageComplete'] = str(task.percentageComplete())
     if task.recurrence():
         self.recurrenceNode(node, task.recurrence())
     if task.budget() != date.TimeDelta():
         node.attrib['budget'] = self.budgetAsAttribute(task.budget())
     if task.priority():
         node.attrib['priority'] = str(task.priority())
     if task.hourlyFee():
         node.attrib['hourlyFee'] = str(task.hourlyFee())
     if task.fixedFee():
         node.attrib['fixedFee'] = str(task.fixedFee())
     reminder = task.reminder() 
     if reminder != maxDateTime and reminder != None:
         node.attrib['reminder'] = str(reminder)
         reminderBeforeSnooze = task.reminder(includeSnooze=False)
         if reminderBeforeSnooze != None and reminderBeforeSnooze < task.reminder():
             node.attrib['reminderBeforeSnooze'] = str(reminderBeforeSnooze)
     prerequisiteIds = ' '.join([prerequisite.id() for prerequisite in \
         sortedById(task.prerequisites())])
     if prerequisiteIds:            
         node.attrib['prerequisites'] = prerequisiteIds
     if task.shouldMarkCompletedWhenAllChildrenCompleted() != None:
         node.attrib['shouldMarkCompletedWhenAllChildrenCompleted'] = \
                           str(task.shouldMarkCompletedWhenAllChildrenCompleted())
     for effort in sortedById(task.efforts()):
         self.effortNode(node, effort)
     for eachNote in sortedById(task.notes()):
         self.noteNode(node, eachNote)
     for attachment in sortedById(task.attachments()):
         self.attachmentNode(node, attachment)
     return node
Exemplo n.º 5
0
 def taskNode(self, task): # pylint: disable-msg=W0621
     maxDateTime = self.maxDateTime
     node = self.baseCompositeNode(task, 'task', self.taskNode)
     node.setAttribute('status', str(task.getStatus()))
     if task.startDateTime() != maxDateTime:
         node.setAttribute('startdate', str(task.startDateTime()))
     if task.dueDateTime() != maxDateTime:
         node.setAttribute('duedate', str(task.dueDateTime()))
     if task.completionDateTime() != maxDateTime:
         node.setAttribute('completiondate', str(task.completionDateTime()))
     if task.percentageComplete() != 0:
         node.setAttribute('percentageComplete', str(task.percentageComplete()))
     if task.recurrence():
         node.appendChild(self.recurrenceNode(task.recurrence()))
     if task.budget() != date.TimeDelta():
         node.setAttribute('budget', self.budgetAsAttribute(task.budget()))
     if task.priority() != 0:
         node.setAttribute('priority', str(task.priority()))
     if task.hourlyFee() != 0:
         node.setAttribute('hourlyFee', str(task.hourlyFee()))
     if task.fixedFee() != 0:
         node.setAttribute('fixedFee', str(task.fixedFee()))
     if task.reminder() != None:
         node.setAttribute('reminder', str(task.reminder()))
     prerequisiteIds = ' '.join([prerequisite.id() for prerequisite in \
         task.prerequisites()])
     if prerequisiteIds:            
         node.setAttribute('prerequisites', prerequisiteIds)
     if task.shouldMarkCompletedWhenAllChildrenCompleted() != None:
         node.setAttribute('shouldMarkCompletedWhenAllChildrenCompleted', 
                           str(task.shouldMarkCompletedWhenAllChildrenCompleted()))
     for effort in task.efforts():
         node.appendChild(self.effortNode(effort))
     for eachNote in task.notes():
         node.appendChild(self.noteNode(eachNote))
     for attachment in task.attachments():
         node.appendChild(self.attachmentNode(attachment))
     return node
Exemplo n.º 6
0
 def taskNode(self, task):  # pylint: disable-msg=W0621
     node = self.baseCompositeNode(task, "task", self.taskNode)
     node.setAttribute("status", str(task.getStatus()))
     if task.startDateTime() != date.DateTime():
         node.setAttribute("startdate", str(task.startDateTime()))
     if task.dueDateTime() != date.DateTime():
         node.setAttribute("duedate", str(task.dueDateTime()))
     if task.completionDateTime() != date.DateTime():
         node.setAttribute("completiondate", str(task.completionDateTime()))
     if task.percentageComplete() != 0:
         node.setAttribute("percentageComplete", str(task.percentageComplete()))
     if task.recurrence():
         node.appendChild(self.recurrenceNode(task.recurrence()))
     if task.budget() != date.TimeDelta():
         node.setAttribute("budget", self.budgetAsAttribute(task.budget()))
     if task.priority() != 0:
         node.setAttribute("priority", str(task.priority()))
     if task.hourlyFee() != 0:
         node.setAttribute("hourlyFee", str(task.hourlyFee()))
     if task.fixedFee() != 0:
         node.setAttribute("fixedFee", str(task.fixedFee()))
     if task.reminder() != None:
         node.setAttribute("reminder", str(task.reminder()))
     prerequisiteIds = " ".join([prerequisite.id() for prerequisite in task.prerequisites()])
     if prerequisiteIds:
         node.setAttribute("prerequisites", prerequisiteIds)
     if task.shouldMarkCompletedWhenAllChildrenCompleted() != None:
         node.setAttribute(
             "shouldMarkCompletedWhenAllChildrenCompleted", str(task.shouldMarkCompletedWhenAllChildrenCompleted())
         )
     for effort in task.efforts():
         node.appendChild(self.effortNode(effort))
     for eachNote in task.notes():
         node.appendChild(self.noteNode(eachNote))
     for attachment in task.attachments():
         node.appendChild(self.attachmentNode(attachment))
     return node
Exemplo n.º 7
0
 def noteImageIndex(self, task, which):
     return self.imageIndex['note'] if task.notes() else -1