GitHub: Fix Python 2 support again.
parent
1e98566101
commit
d3e9420b02
|
@ -67,6 +67,7 @@ class Punishment(registry.String):
|
|||
if s not in ('ban', 'kick', 'kban') and not s.startswith('mode+') and \
|
||||
not s.startswith('mode-') and not s.startswith('umode-') and \
|
||||
not s.startswith('umode+') and \
|
||||
not s.startswith('mmode-') and not s.startswith('mmode-') and \
|
||||
not s.startswith('command ') and \
|
||||
not s.startswith('kban+') and not s.startswith('ban+') :
|
||||
self.error()
|
||||
|
|
|
@ -235,7 +235,10 @@ class AttackProtector(callbacks.Plugin):
|
|||
msg = ircmsgs.mode(channel, punishment[len('mode'):])
|
||||
irc.queueMsg(msg)
|
||||
elif punishment.startswith('umode'):
|
||||
msg = ircmsgs.mode(channel, (punishment[len('umode'):], banmask))
|
||||
msg = ircmsgs.mode(channel, (punishment[len('umode'):], msg.nick))
|
||||
irc.queueMsg(msg)
|
||||
elif punishment.startswith('mmode'):
|
||||
msg = ircmsgs.mode(channel, (punishment[len('mmode'):], banmask))
|
||||
irc.queueMsg(msg)
|
||||
elif punishment.startswith('command '):
|
||||
tokens = callbacks.tokenize(punishment[len('command '):])
|
||||
|
|
|
@ -158,7 +158,9 @@ class GitHub(callbacks.Plugin):
|
|||
url)
|
||||
if hidden is not None:
|
||||
s += _(' (+ %i hidden commits)') % hidden
|
||||
return ircmsgs.privmsg(channel, u(s))
|
||||
if sys.version_info[0] < 3:
|
||||
s = s.encode('utf-8')
|
||||
return ircmsgs.privmsg(channel, s)
|
||||
|
||||
def onPayload(self, payload):
|
||||
repo = '%s/%s' % (payload['repository']['owner']['name'],
|
||||
|
|
Loading…
Reference in New Issue