~fginther/+junk/kanban-card-prefix-prototype

« back to all changes in this revision

Viewing changes to html-report

  • Committer: Francis Ginther
  • Date: 2012-08-10 20:20:17 UTC
  • Revision ID: francis.ginther@canonical.com-20120810202017-rg371ddmp0rdn971
Card prefix prototype

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
        self.postponed_wis = postponed_wis
71
71
        self.done_wis = done_wis
72
72
 
 
73
    def getCardType(self, item):
 
74
        """Extracts the card type information from an item.
 
75
 
 
76
        Returns the hover text, card type, and modified item text. Assumes
 
77
        that every item will start with a card type."""
 
78
        type_lookup = {
 
79
            "[Bug Fix Task]": "[BF]",
 
80
            "[Complete]": "[C]",
 
81
            "[Defect]": "[Def]",
 
82
            "[Design]": "[Des]",
 
83
            "[Design Task]": "[DT]",
 
84
            "[Epic]": "[E]",
 
85
            "[Feature]": "[F]",
 
86
            "[Feature Task]": "[FT]",
 
87
            "[Improvement]": "[I]",
 
88
            "[Improvement Task]": "[IT]",
 
89
            "[Insufficient Resources]": "[IR]",
 
90
            "[More Resources Required]": "[MR]",
 
91
            "[Non-coding Task]": "[NC]",
 
92
            "[Planning]": "[P]",
 
93
            "[Sufficient Resourcing]": "[SR]",
 
94
            "[Task]": "[T]",
 
95
            "[User Story]": "[US]",
 
96
        }
 
97
 
 
98
        if ('[' in item) and (']' in item):
 
99
            card_hover = item[:item.find(']') + 1]
 
100
            item = item[len(card_hover):].strip()
 
101
            try:
 
102
                card_type = type_lookup[card_hover]
 
103
            except KeyError:
 
104
                print("WARNING: type_lookup failed: %s" % (card_hover))
 
105
                card_type = "[??]"
 
106
 
 
107
            return card_hover, card_type, item
 
108
 
73
109
 
74
110
class BlueprintGroup(Blueprint):
75
111