# HG changeset patch # User Jeff Hammel # Date 1268250558 18000 # Node ID d5343f681ef970e994964fd5651101d5344809a5 # Parent a03adefacb62357821bd07c2a01d9d81ccdc5f55 add bugzilla handler diff -r a03adefacb62 -r d5343f681ef9 setup.py --- a/setup.py Wed Mar 03 01:07:32 2010 -0500 +++ b/setup.py Wed Mar 10 14:49:18 2010 -0500 @@ -6,7 +6,7 @@ except: description = '' -version = '0.1.2' +version = '0.1.3' setup(name='smartopen', version=version, @@ -35,5 +35,6 @@ Wikipedia = smartopen.handlers:Wikipedia Google = smartopen.handlers:Google Trac = smartopen.handlers:Trac + Bugzilla = smartopen.handlers:Bugzilla """, ) diff -r a03adefacb62 -r d5343f681ef9 smartopen/handlers.py --- a/smartopen/handlers.py Wed Mar 03 01:07:32 2010 -0500 +++ b/smartopen/handlers.py Wed Mar 10 14:49:18 2010 -0500 @@ -99,6 +99,18 @@ return False return True +class Bugzilla(Location): + def __init__(self): + baseurl = 'https://bugzilla.mozilla.org/show_bug.cgi?id=' + Location.__init__(self, baseurl) + + def test(self, query): + try: + int(query) + return True + except: + return False + class Google(Location): def __init__(self): googleurl = 'http://www.google.com/search?hl=en&q=' @@ -106,3 +118,4 @@ def process(self, query): return urllib.quote_plus(query) +