mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 03:33:11 +01:00
Sweede is a fscking retard.
This commit is contained in:
parent
296af52ed9
commit
0e01a1dee8
@ -98,7 +98,13 @@ def canonicalName(command):
|
||||
Currently, this makes everything lowercase and removes all dashes and
|
||||
underscores.
|
||||
"""
|
||||
return command.translate(string.ascii, '\t -_').lower()
|
||||
assert not isinstance(command, unicode)
|
||||
special = '\t -_'
|
||||
reAppend = ''
|
||||
while command and command[-1] in special:
|
||||
reAppend = command[-1] + reAppend
|
||||
command = command[:-1]
|
||||
return command.translate(string.ascii, special).lower() + reAppend
|
||||
|
||||
def reply(msg, s, prefixName=True, private=False, notice=False):
|
||||
"""Makes a reply to msg with the payload s"""
|
||||
|
@ -124,7 +124,8 @@ class FunctionsTestCase(unittest.TestCase):
|
||||
self.assertEqual('foobar', callbacks.canonicalName('FOO-bar'))
|
||||
self.assertEqual('foobar', callbacks.canonicalName('FOOBAR'))
|
||||
self.assertEqual('foobar', callbacks.canonicalName('foo___bar'))
|
||||
self.assertEqual('foobar', callbacks.canonicalName('_f_o_o-b_a_r_'))
|
||||
self.assertEqual('foobar', callbacks.canonicalName('_f_o_o-b_a_r'))
|
||||
self.assertEqual('foobar--', callbacks.canonicalName('foobar--'))
|
||||
|
||||
def testAddressed(self):
|
||||
oldprefixchars = conf.prefixChars
|
||||
|
Loading…
Reference in New Issue
Block a user