Don't send empty queries.

This commit is contained in:
Jeremy Fincher 2004-08-31 05:53:05 +00:00
parent e138211f9b
commit 6985fe3803
1 changed files with 10 additions and 0 deletions

View File

@ -182,6 +182,14 @@ conf.registerGlobalValue(conf.supybot.plugins.Google, 'licenseKey',
Services API. This is necessary before you can do any searching with this
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):
threaded = True
regexps = sets.Set(['googleSnarfer', 'googleGroups'])
@ -250,6 +258,8 @@ class Google(callbacks.PrivmsgCommandAndRegexp):
kwargs['filter'] = False
else:
kwargs[option[2:]] = argument
if not rest:
raise callbacks.ArgumentError
try:
data = search(self.log, rest, **kwargs)
except google.NoLicenseKey, e: