~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bugtracker.py

  • Committer: John Arbash Meinel
  • Date: 2007-12-05 22:52:58 UTC
  • mfrom: (3080 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3084.
  • Revision ID: john@arbash-meinel.com-20071205225258-kn799zf3tewncv7p
[merge] bzr.dev 3080

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
tracker_registry.register(
172
172
    'bugzilla',
173
173
    URLParametrizedIntegerBugTracker('bugzilla', 'show_bug.cgi?id='))
 
174
 
 
175
 
 
176
class GenericBugTracker(URLParametrizedIntegerBugTracker):
 
177
    """Generic bug tracker specified by an URL template."""
 
178
 
 
179
    def __init__(self):
 
180
        super(GenericBugTracker, self).__init__('bugtracker', None)
 
181
 
 
182
    def get(self, abbreviation, branch):
 
183
        self._abbreviation = abbreviation
 
184
        return super(GenericBugTracker, self).get(abbreviation, branch)
 
185
 
 
186
    def _get_bug_url(self, bug_id):
 
187
        """Given a validated bug_id, return the bug's web page's URL."""
 
188
        if '{id}' not in self._base_url:
 
189
            raise errors.InvalidBugTrackerURL(self._abbreviation,
 
190
                                              self._base_url)
 
191
        return self._base_url.replace('{id}', str(bug_id))
 
192
 
 
193
 
 
194
tracker_registry.register('generic', GenericBugTracker())