From f36fdd3d21b4b47a37618389133b5ecbd6aa9f8e Mon Sep 17 00:00:00 2001 From: James Vega Date: Fri, 12 Nov 2004 16:22:06 +0000 Subject: [PATCH] Let's *really* prevent ourselves from reconnecting to the same network. The Raise=True was raising a callbacks.Error which was being caught. --- plugins/Network.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/Network.py b/plugins/Network.py index 1905a8d41..410cda4e6 100644 --- a/plugins/Network.py +++ b/plugins/Network.py @@ -50,6 +50,8 @@ import supybot.privmsgs as privmsgs import supybot.registry as registry import supybot.callbacks as callbacks +class NetworkError(callbacks.Error): + pass class Network(callbacks.Privmsg): _whois = {} @@ -59,13 +61,13 @@ class Network(callbacks.Privmsg): for irc in world.ircs: if irc.network.lower() == network: return irc - raise callbacks.Error, 'I\'m not currently connected to %s.' % network + raise NetworkError, 'I\'m not currently connected to %s.' % network def _getNetwork(self, irc, args): try: self._getIrc(args[0]) return args.pop(0) - except (callbacks.Error, IndexError): + except (NetworkError, IndexError): return irc.network def connect(self, irc, msg, args): @@ -79,7 +81,7 @@ class Network(callbacks.Privmsg): try: otherIrc = self._getIrc(network) irc.error('I\'m already connected to %s.' % network, Raise=True) - except callbacks.Error: + except NetworkError: pass if server: if ':' in server: