def filterTask(self, task):  # pylint: disable=W0621
     result = True
     if task.status() in self.__statusesToHide:
         result = False
     elif self.__hideCompositeTasks and not self.treeMode() and task.children():
         result = False  # Hide composite task
     return result
Beispiel #2
0
 def filterTask(self, task): # pylint: disable-msg=W0621
     result = True
     if self.__hideCompletedTasks and task.completed():
         result = False
     elif self.__hideInactiveTasks and task.inactive():
         result = False
     elif self.__hideActiveTasks and task.active():
         result = False
     elif self.__hideCompositeTasks and not self.treeMode() and task.children():
         result = False
     elif task.dueDateTime(recursive=self.treeMode()) > self.__dueDateTimeFilter():
         result = False
     return result
Beispiel #3
0
 def filterTask(self, task): # pylint: disable-msg=W0621
     result = True
     if self.__hideActiveTasks and task.active():
         result = False # Hide active task
     elif self.__hideCompositeTasks and not self.treeMode() and task.children():
         result = False # Hide composite task
     elif self.__taskDueLaterThanDueDateTimeFilter(task):
         result = False # Hide due task
     elif self.__taskCompletedEarlierThanCompletionDateTimeFilter(task):
         result = False # Hide completed task
     elif self.__startDateTimeFilterString == 'Always' and task.inactive():
         result = False # Hide prerequisite task no matter what start date
     elif self.__taskStartsLaterThanStartDateTimeFilter(task):
         result = False # Hide future task 
     return result
Beispiel #4
0
 def filterTask(self, task):
     result = True
     if self.__hideCompletedTasks and task.completed():
         result = False
     elif self.__hideInactiveTasks and task.inactive():
         result = False
     elif self.__hideOverdueTasks and task.overdue():
         result = False
     elif self.__hideActiveTasks and task.active():
         result = False
     elif self.__hideOverbudgetTasks and \
         task.budgetLeft(recursive=True) < date.TimeDelta():
         result = False
     elif self.__hideCompositeTasks and not self.treeMode() and task.children():
         result = False
     elif task.dueDate(recursive=self.treeMode()) > self.__dueDateFilter:
         result = False
     return result
Beispiel #5
0
 def __setStartDateChildren(self, task):
     taskStartDate = task.startDate()
     for child in task.children():
         if taskStartDate > child.startDate():
             child.setStartDate(taskStartDate)
Beispiel #6
0
 def __setDueDateChildren(self, task):
     taskDueDate = task.dueDate()
     for child in task.children():
         if child.dueDate() > taskDueDate:
             child.setDueDate(taskDueDate)
Beispiel #7
0
 def __markUncompletedChildrenCompleted(self, task):
     taskCompletionDate = task.completionDate()
     for child in task.children():
         if not child.completed():
             child.setRecurrence()
             child.setCompletionDate(taskCompletionDate)
Beispiel #8
0
 def __taskSubject(self, task):
     subject = task.subject()
     if self.treeMode():
         subject += ' '.join([child.subject() for child in \
             task.children(recursive=True) if child in self.observable()])
     return subject
Beispiel #9
0
 def filter(self, tasks):
     viewCompositeTasks = self.__settings.getboolean('view',
                                                     'compositetasks')
     return [task for task in tasks if (viewCompositeTasks or \
             not task.children())]
Beispiel #10
0
 def __setStartDateChildren(self, task):
     for child in task.children():
         if task.startDate() > child.startDate():
             child.setStartDate(task.startDate())
Beispiel #11
0
 def __markUncompletedChildrenCompleted(self, task):
     for child in task.children():
         if not child.completed():
             child.setCompletionDate(task.completionDate())