From 1a228b3e7d13c29fa15778d74fd06f1885d791a7 Mon Sep 17 00:00:00 2001 From: Daniel Folkinshteyn Date: Wed, 2 Jun 2010 18:36:27 -0400 Subject: [PATCH] fix google calc to work when doing a currency conversion. made the calcre more generic, so it finds stuff on both math and currency. nothing a little exploration of google html page source couldn't solve. --- plugins/Google/plugin.py | 2 +- plugins/Google/test.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Google/plugin.py b/plugins/Google/plugin.py index edd9f829b..59b8f6ddd 100644 --- a/plugins/Google/plugin.py +++ b/plugins/Google/plugin.py @@ -349,7 +349,7 @@ class Google(callbacks.PluginRegexp): url = r'http://google.com/search?q=' + s return url - _calcRe = re.compile(r'(.*?)', re.I) + _calcRe = re.compile(r'(.*?)', re.I) _calcSupRe = re.compile(r'(.*?)', re.I) _calcFontRe = re.compile(r'(.*?)') _calcTimesRe = re.compile(r'&(?:times|#215);') diff --git a/plugins/Google/test.py b/plugins/Google/test.py index 0b73b504c..3d42ca085 100644 --- a/plugins/Google/test.py +++ b/plugins/Google/test.py @@ -38,6 +38,7 @@ class GoogleTestCase(ChannelPluginTestCase): def testCalc(self): self.assertNotRegexp('google calc e^(i*pi)+1', r'didn\'t') + self.assertNotRegexp('google calc 1 usd in gbp', r'didn\'t') def testHtmlHandled(self): self.assertNotRegexp('google calc '