mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
Filter & Google: Fix Python 3.2 compatibility.
This commit is contained in:
parent
8ad16701ce
commit
23ddfbc7e3
@ -703,7 +703,7 @@ class Filter(callbacks.Plugin):
|
||||
if c in self._uniudMap:
|
||||
tmp = self._uniudMap[c]
|
||||
if not len(tmp):
|
||||
tmp = u'\ufffd'
|
||||
tmp = '\ufffd'
|
||||
turned.append(tmp)
|
||||
tlen += 1
|
||||
elif c == '\t':
|
||||
@ -713,7 +713,7 @@ class Filter(callbacks.Plugin):
|
||||
elif ord(c) >= 32:
|
||||
turned.append(c)
|
||||
tlen += 1
|
||||
s = u'%s \x02 \x02' % u''.join(reversed(turned))
|
||||
s = '%s \x02 \x02' % ''.join(reversed(turned))
|
||||
irc.reply(s)
|
||||
uniud = wrap(uniud, ['text'])
|
||||
Filter = internationalizeDocstring(Filter)
|
||||
|
@ -37,6 +37,7 @@ import codecs
|
||||
|
||||
import supybot.utils as utils
|
||||
import supybot.callbacks as callbacks
|
||||
from supybot.minisix import u
|
||||
|
||||
class FilterTest(ChannelPluginTestCase):
|
||||
plugins = ('Filter', 'Utilities', 'Reply')
|
||||
@ -98,7 +99,7 @@ class FilterTest(ChannelPluginTestCase):
|
||||
self.assertResponse('rot13 [rot13 %s]' % s, s)
|
||||
|
||||
def testRot13HandlesNonAsciiStuff(self):
|
||||
self.assertNotError(u'rot13 é')
|
||||
self.assertNotError(u('rot13 é'))
|
||||
|
||||
def testHexlifyUnhexlify(self):
|
||||
for s in map(str, range(1000, 1010)):
|
||||
|
@ -152,7 +152,7 @@ class Google(callbacks.PluginRegexp):
|
||||
elif onetoone:
|
||||
return results
|
||||
else:
|
||||
return [u'; '.join(results)]
|
||||
return [minisix.u('; ').join(results)]
|
||||
|
||||
@internationalizeDocstring
|
||||
def lucky(self, irc, msg, args, opts, text):
|
||||
|
Loading…
Reference in New Issue
Block a user