def do_command(self): super(NewEffortCommand, self).do_command() for effort in self.efforts: # pylint: disable=W0621 task = effort.task() if task not in self.__oldActualStartDateTimes and effort.getStart() < task.actualStartDateTime(): self.__oldActualStartDateTimes[task] = task.actualStartDateTime() task.setActualStartDateTime(effort.getStart()) task.addEffort(effort)
def do_command(self): super(NewEffortCommand, self).do_command() for effort in self.efforts: # pylint: disable=W0621 task = effort.task() if task not in self.__oldActualStartDateTimes and effort.getStart( ) < task.actualStartDateTime(): self.__oldActualStartDateTimes[ task] = task.actualStartDateTime() task.setActualStartDateTime(effort.getStart()) task.addEffort(effort)
def renderPeriod(self, effort): if self._hasRepeatedPeriod(effort): return '' start = effort.getStart() if self.aggregation == 'details': return render.dateTimePeriod(start, effort.getStop()) elif self.aggregation == 'day': return render.date(start.date()) elif self.aggregation == 'week': return render.weekNumber(start) elif self.aggregation == 'month': return render.month(start)
def _hasRepeatedPeriod(self, effort): ''' Return whether the effort has the same period as the previous effort record. ''' index = self.presentation().index(effort) previousEffort = index > 0 and self.presentation()[index-1] or None return previousEffort and effort.getStart() == previousEffort.getStart()