예제 #1
0
 def __createStatusSortKey(self):
     if self.__sortByTaskStatusFirst:
         if self.isAscending():
             return lambda task: [task.completed(), task.inactive()]
         else:
             return lambda task: [not task.completed(), not task.inactive()]
     else:
         return lambda task: []
예제 #2
0
 def __createStatusSortKey(self):
     if self.__sortByTaskStatusFirst:
         if self._sortAscending:
             return lambda task: [task.completed(), task.inactive()]
         else:
             return lambda task: [not task.completed(), not task.inactive()]
     else:
         return lambda task: []
예제 #3
0
 def onCompletionDate(self, event):
     task = event.source()
     if task.parent():
         self.__markParentCompletedOrUncompletedIfNecessary(task.parent(), 
             task)
     if task.completed():
         self.__markUncompletedChildrenCompleted(task)
         if task.isBeingTracked():
             task.stopTracking()
예제 #4
0
파일: filter.py 프로젝트: asone77/taskcoach
 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
예제 #5
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
예제 #6
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
예제 #7
0
 def filterTask(self, task, hideCompletedTasks, hideInactiveTasks, 
                hideOverdueTasks, hideActiveTasks, hideOverBudgetTasks,
                viewTasksDueBeforeDate):
     result = True
     if hideCompletedTasks and task.completed():
         result = False
     elif hideInactiveTasks and task.inactive():
         result = False
     elif hideOverdueTasks and task.overdue():
         result = False
     elif hideActiveTasks and task.active():
         result = False
     elif hideOverBudgetTasks and \
         task.budgetLeft(recursive=True) < date.TimeDelta():
         result = False
     elif task.dueDate(recursive=self.treeMode()) > viewTasksDueBeforeDate:
         result = False        
     return result
예제 #8
0
 def __markTaskUncompletedIfNecessary(self, task):
     if task.completed():
         task.setCompletionDate(date.Date())
예제 #9
0
 def __markTaskCompletedIfNecessary(self, task, completionDate):
     if task.allChildrenCompleted() and not task.completed() and \
             self.__shouldMarkTaskCompletedWhenAllChildrenCompleted(task):
         task.setCompletionDate(completionDate)