Mercurial > hg > smartopen
comparison 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 |
comparison
equal
deleted
inserted
replaced
6:a03adefacb62 | 7:d5343f681ef9 |
---|---|
97 | 97 |
98 if 'Wikipedia does not have an article with this exact name' in f: | 98 if 'Wikipedia does not have an article with this exact name' in f: |
99 return False | 99 return False |
100 return True | 100 return True |
101 | 101 |
102 class Bugzilla(Location): | |
103 def __init__(self): | |
104 baseurl = 'https://bugzilla.mozilla.org/show_bug.cgi?id=' | |
105 Location.__init__(self, baseurl) | |
106 | |
107 def test(self, query): | |
108 try: | |
109 int(query) | |
110 return True | |
111 except: | |
112 return False | |
113 | |
102 class Google(Location): | 114 class Google(Location): |
103 def __init__(self): | 115 def __init__(self): |
104 googleurl = 'http://www.google.com/search?hl=en&q=' | 116 googleurl = 'http://www.google.com/search?hl=en&q=' |
105 Location.__init__(self, googleurl) | 117 Location.__init__(self, googleurl) |
106 | 118 |
107 def process(self, query): | 119 def process(self, query): |
108 return urllib.quote_plus(query) | 120 return urllib.quote_plus(query) |
121 |