Added some __repr__ action.

This commit is contained in:
Jeremy Fincher 2004-09-14 15:38:49 +00:00
parent 5f1aa43ee0
commit 934363db10
2 changed files with 12 additions and 2 deletions

View File

@ -507,10 +507,16 @@ class IrcSet(utils.NormalizingSet):
class FloodQueue(object):
timeout = 0
def __init__(self, timeout=None):
def __init__(self, timeout=None, queues=None):
if timeout is not None:
self.timeout = timeout
self.queues = IrcDict()
if queues is None:
queues = IrcDict()
self.queues = queues
def __repr__(self):
return 'FloodQueue(timeout=%r, queues=%s)' % (self.timeout,
repr(self.queues))
def key(self, msg):
return msg.user + '@' + msg.host

View File

@ -651,6 +651,10 @@ class InsensitivePreservingDict(UserDict.DictMixin, object):
if dict is not None:
self.update(dict)
def __repr__(self):
return '%s(%s)' % (self.__class__.__name__,
super(InsensitivePreservingDict, self).__repr__())
def fromkeys(cls, keys, s=None, dict=None, key=None):
d = cls(dict=dict, key=key)
for key in keys: