~kanban/kanban/trunk

« back to all changes in this revision

Viewing changes to kanban/commands.py

  • Committer: Jamu Kakar
  • Date: 2011-02-06 22:35:56 UTC
  • mfrom: (16.1.2 warning-signals)
  • Revision ID: jkakar@kakar.ca-20110206223556-d2p08upuigfoncwd
Merged warning-signals [f=713032]

Warning and danger icons are shown on bugs that have been in progress
or in the review queue for too long.  The warning icon is shown when a
bug has been in progress for more than three days or in the review
queue for more than one day.  The danger icon is shown when a bug has
been in progress for more than seven days or in the review queue for
more than three days.  Bugs related to the -o flag, that slipped in
with the last merge, have also been fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
    """
57
57
 
58
58
    takes_args = ["person_name"]
59
 
    takes_options = [Option("output-file", short_name="o",
 
59
    takes_options = [Option("output-file", short_name="o", type=str,
60
60
                            help="Write HTML to file.")]
61
61
    _see_also = ["launchpad-login"]
62
62
 
66
66
        bugs = get_person_assigned_bugs(launchpad, person_name)
67
67
        for bug in sorted(bugs, compare_bugs):
68
68
            milestone.add(bug)
69
 
        self._write_output(generate_html(milestone), output_file)
 
69
        self.write_output(generate_html(milestone), output_file)
70
70
 
71
71
 
72
72
class cmd_generate_milestone_kanban(HTMLOutputMixin, Command):
73
73
    """Print an HTML kanban board for a milestone to the screen."""
74
74
 
75
75
    takes_args = ["project_group", "milestone_name"]
76
 
    takes_options = [Option("output-file", short_name="o",
77
 
                            help="Write HTML to file.")]
 
76
    takes_options = [Option("output-file", short_name="o", type=str,
 
77
                            help="Write HTML to file."),
 
78
                     Option("warning-limit", short_name="w", type=int,
 
79
                            help="The number of days to wait before showing "
 
80
                                 "a warning signal.")]
78
81
    _see_also = ["launchpad-login"]
79
82
 
80
 
    def run(self, project_group, milestone_name, output_file=None):
 
83
    def run(self, project_group, milestone_name, output_file=None,
 
84
            warning_limit=None):
81
85
        launchpad = get_launchpad()
82
 
        milestone = Milestone(project_group, milestone_name)
 
86
        milestone = Milestone(project_group, milestone_name,
 
87
                              warning_limit=warning_limit)
83
88
        bugs = get_milestone_bugs(launchpad, project_group, milestone_name)
84
89
        for bug in sorted(bugs, compare_bugs):
85
90
            milestone.add(bug)
86
 
        self._write_output(generate_html(milestone), output_file)
 
91
        self.write_output(generate_html(milestone), output_file)
87
92
 
88
93
 
89
94
class cmd_generate_roadmap(HTMLOutputMixin, Command):