mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Don't send empty queries.
This commit is contained in:
parent
e138211f9b
commit
6985fe3803
@ -182,6 +182,14 @@ conf.registerGlobalValue(conf.supybot.plugins.Google, 'licenseKey',
|
|||||||
Services API. This is necessary before you can do any searching with this
|
Services API. This is necessary before you can do any searching with this
|
||||||
module.""", private=True))
|
module.""", private=True))
|
||||||
|
|
||||||
|
conf.registerGroup(conf.supybot.plugins.Google, 'state')
|
||||||
|
conf.registerGlobalValue(conf.supybot.plugins.Google.state, 'searches',
|
||||||
|
registry.Float(0.0, """Used to keep the total number of searches Google has
|
||||||
|
done for this bot. You shouldn't modify this."""))
|
||||||
|
conf.registerGlobalValue(conf.supybot.plugins.Google.state, 'time',
|
||||||
|
registry.Float(0.0, """Used to keep the total amount of time Google has
|
||||||
|
spent searching for this bot. You shouldn't modify this."""))
|
||||||
|
|
||||||
class Google(callbacks.PrivmsgCommandAndRegexp):
|
class Google(callbacks.PrivmsgCommandAndRegexp):
|
||||||
threaded = True
|
threaded = True
|
||||||
regexps = sets.Set(['googleSnarfer', 'googleGroups'])
|
regexps = sets.Set(['googleSnarfer', 'googleGroups'])
|
||||||
@ -250,6 +258,8 @@ class Google(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
kwargs['filter'] = False
|
kwargs['filter'] = False
|
||||||
else:
|
else:
|
||||||
kwargs[option[2:]] = argument
|
kwargs[option[2:]] = argument
|
||||||
|
if not rest:
|
||||||
|
raise callbacks.ArgumentError
|
||||||
try:
|
try:
|
||||||
data = search(self.log, rest, **kwargs)
|
data = search(self.log, rest, **kwargs)
|
||||||
except google.NoLicenseKey, e:
|
except google.NoLicenseKey, e:
|
||||||
|
Loading…
Reference in New Issue
Block a user