changeset 7:d5343f681ef9

add bugzilla handler
author Jeff Hammel <k0scist@gmail.com>
date Wed, 10 Mar 2010 14:49:18 -0500
parents a03adefacb62
children 44950f376e98
files setup.py smartopen/handlers.py
diffstat 2 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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
       """,
       )
--- 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)
+