From 6985fe38033f2c0d85b74960d45778c684039fd2 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 31 Aug 2004 05:53:05 +0000 Subject: [PATCH] Don't send empty queries. --- plugins/Google.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/Google.py b/plugins/Google.py index 7b1f2f9be..79d302f0f 100644 --- a/plugins/Google.py +++ b/plugins/Google.py @@ -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: