From f2fd7c9e66c51406d47561e3dd3a3cf8380115b1 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 26 Aug 2004 04:43:19 +0000 Subject: [PATCH] oops, got this reversed. --- src/irclib.py | 13 ++++++++----- test/test_irclib.py | 7 +++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/irclib.py b/src/irclib.py index 6518a0fe5..bca06f348 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -339,11 +339,14 @@ class IrcState(IrcCommandDispatcher): }) def _prefixParser(s): - (left, right) = s.split(')') - assert left[0] == '(', 'Odd PREFIX in 005: %s' % s - left = left[1:] - assert len(left) == len(right), 'Odd PREFIX in 005: %s' % s - return dict(zip(left, right)) + if ')' in s: + (left, right) = s.split(')') + assert left[0] == '(', 'Odd PREFIX in 005: %s' % s + left = left[1:] + assert len(left) == len(right), 'Odd PREFIX in 005: %s' % s + return dict(zip(left, right)) + else: + return dict(zip('ovh', s)) _005converters['prefix'] = _prefixParser del _prefixParser def do005(self, irc, msg): diff --git a/test/test_irclib.py b/test/test_irclib.py index 875a48989..e2e4a8067 100644 --- a/test/test_irclib.py +++ b/test/test_irclib.py @@ -225,6 +225,13 @@ class IrcStateTestCase(SupyTestCase): conf.supybot.protocols.irc.maxHistoryLength():]) conf.supybot.protocols.irc.maxHistoryLength.setValue(oldconfmaxhistory) + def testWasteland005(self): + state = irclib.IrcState() + # Here we're testing if PREFIX works without the (ov) there. + state.addMsg(self.irc, ircmsgs.IrcMsg(':desolate.wasteland.org 005 jemfinch NOQUIT WATCH=128 SAFELIST MODES=6 MAXCHANNELS=10 MAXBANS=100 NICKLEN=30 TOPICLEN=307 KICKLEN=307 CHANTYPES=&# PREFIX=@+ NETWORK=DALnet SILENCE=10 :are available on this server')) + self.assertEqual(state.supported['prefix']['o'], '@') + self.assertEqual(state.supported['prefix']['v'], '+') + def testEmptyTopic(self): state = irclib.IrcState() state.addMsg(self.irc, ircmsgs.topic('#foo'))