예제 #1
0
 def _createColumns(self):
     return [widgets.Column(name, columnHeader, eventType, 
             renderCallback=renderCallback, width=self.getColumnWidth(name),
             resizeCallback=self.onResizeColumn) \
         for name, columnHeader, eventType, renderCallback in \
         ('period', _('Period'), 'effort.duration', self.renderPeriod),
         ('task', _('Task'), effort.Effort.taskChangedEventType(), lambda effort: effort.task().subject(recursive=True)),
         ('description', _('Description'), effort.Effort.descriptionChangedEventType(), lambda effort: effort.description())] + \
         [widgets.Column('categories', _('Categories'),
          width=self.getColumnWidth('categories'),
          renderCallback=self.renderCategory, 
          renderDescriptionCallback=lambda effort: effort.description(),
          resizeCallback=self.onResizeColumn)] + \
         [widgets.Column('totalCategories', _('Overall categories'),
          width=self.getColumnWidth('totalCategories'),
          renderCallback=lambda effort: self.renderCategory(effort, recursive=True),
          renderDescriptionCallback=lambda effort: effort.description(),
          resizeCallback=self.onResizeColumn)] + \
         [widgets.Column(name, columnHeader, eventType, 
          width=self.getColumnWidth(name), resizeCallback=self.onResizeColumn,
          renderCallback=renderCallback, alignment=wx.LIST_FORMAT_RIGHT) \
         for name, columnHeader, eventType, renderCallback in \
         ('timeSpent', _('Time spent'), 'effort.duration', 
             lambda effort: render.timeSpent(effort.duration())),
         ('revenue', _('Revenue'), 'effort.revenue', 
             lambda effort: render.amount(effort.revenue())),
         ('totalTimeSpent', _('Total time spent'), 'effort.totalDuration',  
              lambda effort: render.timeSpent(effort.duration(recursive=True))),
         ('totalRevenue', _('Total revenue'), 'effort.totalRevenue',
              lambda effort: render.amount(effort.revenue(recursive=True)))] + \
          [widgets.Column(name, columnHeader, eventType, 
           renderCallback=renderCallback, alignment=wx.LIST_FORMAT_RIGHT,
           width=self.getColumnWidth(name), resizeCallback=self.onResizeColumn) \
          for name, columnHeader, eventType, renderCallback in \
             ('monday', _('Monday'), 'effort.duration',  
              lambda effort: self.renderTimeSpentOnDay(effort, 0)),                             
             ('tuesday', _('Tuesday'), 'effort.duration',  
              lambda effort: self.renderTimeSpentOnDay(effort, 1)),
             ('wednesday', _('Wednesday'), 'effort.duration',  
              lambda effort: self.renderTimeSpentOnDay(effort, 2)),
             ('thursday', _('Thursday'), 'effort.duration',  
              lambda effort: self.renderTimeSpentOnDay(effort, 3)),
             ('friday', _('Friday'), 'effort.duration',  
              lambda effort: self.renderTimeSpentOnDay(effort, 4)),
             ('saturday', _('Saturday'), 'effort.duration',  
              lambda effort: self.renderTimeSpentOnDay(effort, 5)),
             ('sunday', _('Sunday'), 'effort.duration',  
              lambda effort: self.renderTimeSpentOnDay(effort, 6))      
          ]
예제 #2
0
 def _createColumns(self):
     # pylint: disable-msg=W0142
     kwargs = dict(renderDescriptionCallback=lambda effort: effort.description(),
                   resizeCallback=self.onResizeColumn)
     return [widgets.Column(name, columnHeader, eventType, 
             renderCallback=renderCallback,
             sortCallback=sortCallback,
             width=self.getColumnWidth(name), **kwargs) \
         for name, columnHeader, eventType, renderCallback, sortCallback in \
         ('period', _('Period'), 'effort.duration', self.renderPeriod, 
          uicommand.ViewerSortByCommand(viewer=self, value='period')),
         ('task', _('Task'), effort.Effort.taskChangedEventType(), lambda effort: effort.task().subject(recursive=True), None),
         ('description', _('Description'), effort.Effort.descriptionChangedEventType(), lambda effort: effort.description(), None)] + \
         [widgets.Column('categories', _('Categories'),
          width=self.getColumnWidth('categories'),
          renderCallback=self.renderCategories, **kwargs)] + \
         [widgets.Column(name, columnHeader, eventType, 
          width=self.getColumnWidth(name),
          renderCallback=renderCallback, alignment=wx.LIST_FORMAT_RIGHT,
          **kwargs) \
         for name, columnHeader, eventType, renderCallback in \
         ('timeSpent', _('Time spent'), 'effort.duration', 
             lambda effort: render.timeSpent(effort.duration())),
         ('totalTimeSpent', _('Total time spent'), 'effort.duration',
             lambda effort: render.timeSpent(effort.duration(recursive=True))),
         ('revenue', _('Revenue'), 'effort.revenue', 
             lambda effort: render.monetaryAmount(effort.revenue())),
         ('totalRevenue', _('Total revenue'), 'effort.revenue',
             lambda effort: render.monetaryAmount(effort.revenue(recursive=True)))] + \
          [widgets.Column(name, columnHeader, eventType, 
           renderCallback=renderCallback, alignment=wx.LIST_FORMAT_RIGHT,
           width=self.getColumnWidth(name), **kwargs) \
          for name, columnHeader, eventType, renderCallback in \
             ('monday', _('Monday'), 'effort.duration',  
              lambda effort: self.renderTimeSpentOnDay(effort, 0)),                             
             ('tuesday', _('Tuesday'), 'effort.duration',  
              lambda effort: self.renderTimeSpentOnDay(effort, 1)),
             ('wednesday', _('Wednesday'), 'effort.duration',  
              lambda effort: self.renderTimeSpentOnDay(effort, 2)),
             ('thursday', _('Thursday'), 'effort.duration',  
              lambda effort: self.renderTimeSpentOnDay(effort, 3)),
             ('friday', _('Friday'), 'effort.duration',  
              lambda effort: self.renderTimeSpentOnDay(effort, 4)),
             ('saturday', _('Saturday'), 'effort.duration',  
              lambda effort: self.renderTimeSpentOnDay(effort, 5)),
             ('sunday', _('Sunday'), 'effort.duration',  
              lambda effort: self.renderTimeSpentOnDay(effort, 6))      
          ]