~lool/launchpad-work-items-tracker/backlog-timestamp-in-2099

« back to all changes in this revision

Viewing changes to lpworkitems/error_collector.py

  • Committer: Mattias Backman
  • Date: 2012-02-01 18:15:21 UTC
  • mto: (330.2.1 linaro-staging)
  • mto: This revision was merged to the branch mainline in revision 331.
  • Revision ID: mattias.backman@linaro.org-20120201181521-pn8ldtw4o9y1afxw
Use project names as keys for error emails, instead of blueprint regexps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        """Get the name of the blueprint, or None if not a blueprint."""
49
49
        return None
50
50
 
 
51
    def get_project_name(self):
 
52
        """Get the name of the project, or None if not a project."""
 
53
        return None
 
54
 
51
55
    def format_for_display(self):
52
56
        """Produce a string representation of the Error.
53
57
 
84
88
    def get_blueprint_name(self):
85
89
        return self.blueprint.name
86
90
 
 
91
    def get_project_name(self):
 
92
        return self.blueprint.url.split('/')[-3]
 
93
 
87
94
 
88
95
class BlueprintURLError(Error):
89
96
    """A deprecated class for backwards-compatibility.
101
108
    def get_blueprint_name(self):
102
109
        return self.blueprint_url.split('/')[-1]
103
110
 
 
111
    def get_project_name(self):
 
112
        return self.blueprint_url.split('/')[-3]
 
113
 
104
114
 
105
115
class MilestoneError(Error):
106
116