Merge branch 'master' into tfw_improvements
commit
4386572775
|
@ -22,7 +22,7 @@ subs = [
|
||||||
]
|
]
|
||||||
|
|
||||||
r_google_calc = re.compile(r'calculator-40.gif.*? = (.*?)<')
|
r_google_calc = re.compile(r'calculator-40.gif.*? = (.*?)<')
|
||||||
r_google_calc_exp = re.compile(r'calculator-40.gif.*? = (.*?)<sup>(.*?)<')
|
r_google_calc_exp = re.compile(r'calculator-40.gif.*? = (.*?)<sup>(.*?)</sup></h2>')
|
||||||
|
|
||||||
def c(phenny, input):
|
def c(phenny, input):
|
||||||
"""Google calculator."""
|
"""Google calculator."""
|
||||||
|
|
|
@ -42,8 +42,8 @@ def help(phenny, input):
|
||||||
"For help with a command, just use .help followed by the name of"
|
"For help with a command, just use .help followed by the name of"
|
||||||
" the command, like \".help botsnack\".")
|
" the command, like \".help botsnack\".")
|
||||||
phenny.say(
|
phenny.say(
|
||||||
"If you need additional help can check out {helpurl} or you can "
|
"If you need additional help, check out {helpurl} or talk to my "
|
||||||
"talk to my owner, {owner}.".format(
|
"owner, {owner}.".format(
|
||||||
helpurl=helpurl,
|
helpurl=helpurl,
|
||||||
owner=phenny.config.owner))
|
owner=phenny.config.owner))
|
||||||
help.rule = (['help', 'command'], r'(.*)')
|
help.rule = (['help', 'command'], r'(.*)')
|
||||||
|
|
|
@ -124,7 +124,7 @@ def bing(phenny, input):
|
||||||
bing.commands = ['bing']
|
bing.commands = ['bing']
|
||||||
bing.example = '.bing swhack'
|
bing.example = '.bing swhack'
|
||||||
|
|
||||||
r_duck = re.compile(r'nofollow" class="[^"]+" href=".+?(http.*?)">')
|
r_duck = re.compile(r'web-result.*?nofollow.*?href=".+?(http.*?)"', re.DOTALL)
|
||||||
|
|
||||||
def duck_search(query):
|
def duck_search(query):
|
||||||
query = query.replace('!', '')
|
query = query.replace('!', '')
|
||||||
|
|
|
@ -36,3 +36,9 @@ class TestCalc(unittest.TestCase):
|
||||||
c(self.phenny, input)
|
c(self.phenny, input)
|
||||||
|
|
||||||
self.phenny.reply.assert_called_once_with('Sorry, no result.')
|
self.phenny.reply.assert_called_once_with('Sorry, no result.')
|
||||||
|
|
||||||
|
def test_c_quirk(self):
|
||||||
|
input = Mock(group=lambda x: '24/50')
|
||||||
|
c(self.phenny, input)
|
||||||
|
|
||||||
|
self.phenny.say.assert_called_once_with('0.48')
|
||||||
|
|
|
@ -28,7 +28,7 @@ class TestWeather(unittest.TestCase):
|
||||||
('27959', check_places("Dare County", "North Carolina")),
|
('27959', check_places("Dare County", "North Carolina")),
|
||||||
('48067', check_places("Royal Oak", "Michigan")),
|
('48067', check_places("Royal Oak", "Michigan")),
|
||||||
('23606', check_places("Newport News", "Virginia")),
|
('23606', check_places("Newport News", "Virginia")),
|
||||||
('23113', check_places("Midlothian", "Virginia")),
|
('23113', check_places("Chesterfield County", "Virginia")),
|
||||||
('27517', check_places("Chapel Hill", "North Carolina")),
|
('27517', check_places("Chapel Hill", "North Carolina")),
|
||||||
('15213', check_places("Allegheny County", "Pennsylvania")),
|
('15213', check_places("Allegheny County", "Pennsylvania")),
|
||||||
('90210', check_places("Los Angeles County", "California")),
|
('90210', check_places("Los Angeles County", "California")),
|
||||||
|
|
Loading…
Reference in New Issue