Fixed the one-channel bug.

This commit is contained in:
Jeremy Fincher 2004-07-30 22:35:51 +00:00
parent 7328bd50ba
commit a8a95c2ecc
5 changed files with 13 additions and 14 deletions

View File

@ -202,7 +202,6 @@ class SpaceSeparatedSetOfChannels(registry.SpaceSeparatedListOf):
self.value.remove(removal)
def registerNetwork(name, password='', servers=()):
name = intern(name)
network = registerGroup(supybot.networks, name)
registerGlobalValue(network, 'password', registry.String(password,
"""Determines what password will be used on %s. Yes, we know that

View File

@ -639,11 +639,10 @@ class Irc(IrcCommandDispatcher):
def doNick(self, msg):
"""Handles NICK messages."""
if msg.nick == self.nick:
newNick = intern(msg.args[0])
newNick = msg.args[0]
self.nick = newNick
(nick, user, domain) = ircutils.splitHostmask(msg.prefix)
self.prefix = ircutils.joinHostmask(self.nick, user, domain)
self.prefix = intern(self.prefix)
elif conf.supybot.followIdentificationThroughNickChanges():
# We use elif here because this means it's someone else's nick
# change, not our own.

View File

@ -125,14 +125,13 @@ class IrcMsg(object):
else:
self.args = msg.args
else:
self.prefix = intern(prefix)
self.command = intern(command)
self.prefix = prefix
self.command = command
assert all(ircutils.isValidArgument, args)
self.args = args
self.args = tuple(map(intern, self.args))
self.args = tuple(self.args)
if ircutils.isUserHostmask(self.prefix):
(self.nick,self.user,self.host) = \
map(intern, ircutils.splitHostmask(self.prefix))
(self.nick,self.user,self.host)=ircutils.splitHostmask(self.prefix)
else:
(self.nick, self.user, self.host) = (self.prefix,)*3

View File

@ -103,7 +103,7 @@ _lowertrans = string.maketrans(string.ascii_uppercase + r'\[]~',
string.ascii_lowercase + r'|{}^')
def toLower(s):
"""Returns the string s lowered according to IRC case rules."""
return intern(s.translate(_lowertrans))
return s.translate(_lowertrans)
def strEqual(nick1, nick2):
"""Returns True if nick1 == nick2 according to IRC case rules."""
@ -475,12 +475,10 @@ def unDccIP(i):
class IrcString(str):
"""This class does case-insensitive comparison and hashing of nicks."""
def __new__(cls, s=''):
return str.__new__(cls, intern(s))
x = super(IrcString, cls).__new__(cls, s)
x.lowered = toLower(x)
return x
def __init__(self, s):
assert isinstance(s, basestring), \
'Cannot make an IrcString from %r' % s
self.lowered = toLower(s)
def __eq__(self, s):
try:

View File

@ -39,6 +39,7 @@ import supybot.fix as fix
import os
import re
import sys
import md5
import new
import sha
@ -51,6 +52,7 @@ import compiler
import textwrap
import UserDict
import itertools
import traceback
import htmlentitydefs
from itertools import imap, ifilter
@ -669,6 +671,8 @@ def mungeEmailForWeb(s):
s = s.replace('.', ' DOT ')
return s
def stackTrace():
traceback.print_stack(sys._getframe())
if __name__ == '__main__':
import sys, doctest