mirror of
				https://github.com/Mikaela/Limnoria.git
				synced 2025-11-04 09:37:25 +01:00 
			
		
		
		
	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.
This commit is contained in:
		
							parent
							
								
									f25d1546bf
								
							
						
					
					
						commit
						1a228b3e7d
					
				@ -349,7 +349,7 @@ class Google(callbacks.PluginRegexp):
 | 
			
		||||
        url = r'http://google.com/search?q=' + s
 | 
			
		||||
        return url
 | 
			
		||||
 | 
			
		||||
    _calcRe = re.compile(r'<img src=/images/calc_img\.gif.*?<b>(.*?)</b>', re.I)
 | 
			
		||||
    _calcRe = re.compile(r'<h\d class="?r"?.*?<b>(.*?)</b>', re.I)
 | 
			
		||||
    _calcSupRe = re.compile(r'<sup>(.*?)</sup>', re.I)
 | 
			
		||||
    _calcFontRe = re.compile(r'<font size=-2>(.*?)</font>')
 | 
			
		||||
    _calcTimesRe = re.compile(r'&(?:times|#215);')
 | 
			
		||||
 | 
			
		||||
@ -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 '
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user