예제 #1
0
 def actual_burndown(self, filter_by_component=None):
     command = SprintController.GetActualBurndownCommand(
         self.env,
         sprint=self.sprint.name,
         filter_by_component=filter_by_component,
         remaining_field=BurndownDataConstants.REMAINING_TIME)
     return SprintController(self.env).process_command(command)
예제 #2
0
    def _group_sprints_by_milestone(self, req, milestones_to_show):
        """
        Returns a dict which holds the sprints grouped by milestone 
        (key: milestone, value: list of tuples (sprint, progress bar data)).
        The dict contains only sprints for milestones in milestones_to_show.
        """
        # save sprints in dictionary, key is the associated milestone
        provider = DefaultTicketGroupStatsProvider(self.env)
        
        milestone_names = [milestone.name for milestone in milestones_to_show]
        
        sprints = {}
        sp_controller = SprintController(self.env)
        list_sprints = SprintController.ListSprintsCommand(self.env,
                                                           criteria={'milestone': 'in %s' % \
                                                                     milestone_names})
        for s in sp_controller.process_command(list_sprints):
#            milestone_name = sprint.milestone
#            if (not milestone_name) or (milestone_name not in milestone_names):
#                continue
            milestone_name = s.milestone
            if milestone_name not in sprints:
                sprints[milestone_name] = []
            sprint_stats = self.build_sprint_story_statistics(req, s.name,
                                                              provider=provider)
            sprint_data = (s, sprint_stats)
            sprints[milestone_name].append(sprint_data)
        return sprints
예제 #3
0
 def _sprint(self, req, sprint_name):
     try:
         get_sprint = SprintController.GetSprintCommand(self.env,
                                                        sprint=sprint_name)
         get_sprint.native = True
         return SprintController(self.env).process_command(get_sprint)
     except ICommand.NotValidError, e:
         self.error_response(req, {}, [exception_to_unicode(e)])
예제 #4
0
파일: charts.py 프로젝트: nagyist/agilo
 def _load_sprint(self, sprint_name, native=False):
     sprint = None
     error_message = None
     if sprint_name == None:
         error_message = 'No sprint specified'
     else:
         try:
             # Charts are a layer below the Sprint so they must not import this
             # module globally to avoid recursive imports
             from agilo.scrum.sprint import SprintController
             cmd = SprintController.GetSprintCommand
             cmd_get_sprint = cmd(self.env, sprint=sprint_name)
             cmd_get_sprint.native = native
             sprint = SprintController(
                 self.env).process_command(cmd_get_sprint)
         except Exception, e:
             error_message = 'Sprint %s does not exist' % unicode(e)
             sprint = None
예제 #5
0
 def __init__(self):
     """Initialize a Sprint Controller"""
     self.controller = SprintController(self.env)