~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bugtracker.py

  • Committer: Jonathan Lange
  • Date: 2007-04-13 07:19:12 UTC
  • mto: This revision was merged to the branch mainline in revision 2446.
  • Revision ID: jml@canonical.com-20070413071912-vkcaqm87lduwlfs7
Rename SimpleBugTracker to UniqueBugTracker

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
"""Registry of bug trackers."""
63
63
 
64
64
 
65
 
class SimpleBugTracker(object):
66
 
    """A bug tracker that where bug numbers are appended to a base URL.
 
65
class UniqueBugTracker(object):
 
66
    """A style of bug tracker that exists in one place only, such as Launchpad.
67
67
 
68
68
    If you have one of these trackers then subclass this and add attributes
69
69
    named 'tag' and 'base_url'. The former is the tag that the user will use
91
91
        pass
92
92
 
93
93
 
94
 
class SimpleIntegerBugTracker(SimpleBugTracker):
 
94
class UniqueIntegerBugTracker(UniqueBugTracker):
95
95
    """A SimpleBugtracker where the bug ids must be integers"""
96
96
 
97
97
    def check_bug_id(self, bug_id):
101
101
            raise errors.MalformedBugIdentifier(bug_id, "Must be an integer")
102
102
 
103
103
 
104
 
class LaunchpadTracker(SimpleIntegerBugTracker):
 
104
class LaunchpadTracker(UniqueIntegerBugTracker):
105
105
    """The Launchpad bug tracker."""
106
106
    tag = 'lp'
107
107
    base_url = 'https://launchpad.net/bugs/'
109
109
tracker_registry.register('launchpad', LaunchpadTracker)
110
110
 
111
111
 
112
 
class DebianTracker(SimpleIntegerBugTracker):
 
112
class DebianTracker(UniqueIntegerBugTracker):
113
113
    """The Debian bug tracker."""
114
114
    tag = 'deb'
115
115
    base_url = 'http://bugs.debian.org/'