From 6e8b7be0f138ee0cdf36175e4315a6a87858522e Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Thu, 30 May 2013 13:13:19 +0200 Subject: [PATCH] Google: Fix @calc. --- plugins/Google/plugin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/Google/plugin.py b/plugins/Google/plugin.py index 413bfc225..49b3a88e0 100644 --- a/plugins/Google/plugin.py +++ b/plugins/Google/plugin.py @@ -294,7 +294,7 @@ class Google(callbacks.PluginRegexp): (self.registryValue('baseUrl', channel), s) return url - def _googleUrlIG(self, s): + def _googleUrlIG(self, s, channel): s = s.replace('+', '%2B') s = s.replace(' ', '+') url = r'http://%s/ig/calculator?hl=en&q=%s' % \ @@ -312,7 +312,10 @@ class Google(callbacks.PluginRegexp): Uses Google's calculator to calculate the value of . """ - urlig = self._googleUrlIG(expr) + channel = msg.args[0] + if not isChannel(channel): + channel = None + urlig = self._googleUrlIG(expr, channel) js = utils.web.getUrl(urlig).decode('utf8') # Convert JavaScript to JSON. Ouch. js = js \