GitHub: Fix Python 2 support again.

master
Valentin Lorentz 2013-07-21 11:53:12 +00:00
parent 1e98566101
commit d3e9420b02
3 changed files with 8 additions and 2 deletions

View File

@ -67,6 +67,7 @@ class Punishment(registry.String):
if s not in ('ban', 'kick', 'kban') and not s.startswith('mode+') and \ 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('mode-') and not s.startswith('umode-') 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('command ') and \
not s.startswith('kban+') and not s.startswith('ban+') : not s.startswith('kban+') and not s.startswith('ban+') :
self.error() self.error()

View File

@ -235,7 +235,10 @@ class AttackProtector(callbacks.Plugin):
msg = ircmsgs.mode(channel, punishment[len('mode'):]) msg = ircmsgs.mode(channel, punishment[len('mode'):])
irc.queueMsg(msg) irc.queueMsg(msg)
elif punishment.startswith('umode'): 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) irc.queueMsg(msg)
elif punishment.startswith('command '): elif punishment.startswith('command '):
tokens = callbacks.tokenize(punishment[len('command '):]) tokens = callbacks.tokenize(punishment[len('command '):])

View File

@ -158,7 +158,9 @@ class GitHub(callbacks.Plugin):
url) url)
if hidden is not None: if hidden is not None:
s += _(' (+ %i hidden commits)') % hidden 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): def onPayload(self, payload):
repo = '%s/%s' % (payload['repository']['owner']['name'], repo = '%s/%s' % (payload['repository']['owner']['name'],