Mercurial > hg > smartopen
diff smartopen/handlers.py @ 7:d5343f681ef9
add bugzilla handler
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Wed, 10 Mar 2010 14:49:18 -0500 |
parents | f084e152dd47 |
children | 44950f376e98 |
line wrap: on
line diff
--- 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) +