mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Fixed the one-channel bug.
This commit is contained in:
parent
7328bd50ba
commit
a8a95c2ecc
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user