Fixed testing, w00t!

This commit is contained in:
Jeremy Fincher 2004-02-03 03:07:54 +00:00
parent cb3f763bf0
commit 3bd50b1d6a

View File

@ -516,7 +516,10 @@ class UsersDictionary(utils.IterableMap):
if self.filename is not None: if self.filename is not None:
self.nextId = 0 self.nextId = 0
self.users.clear() self.users.clear()
self.open(self.filename) try:
self.open(self.filename)
except EnvironmentError, e:
log.warning('UsersDictionary.reload failed: %s', e)
else: else:
log.warning('UsersDictionary.reload called without self.filename.') log.warning('UsersDictionary.reload called without self.filename.')
@ -660,15 +663,18 @@ class ChannelsDictionary(utils.IterableMap):
c.preserve(fd, indent=' ') c.preserve(fd, indent=' ')
fd.close() fd.close()
else: else:
log.warning('ChannelsDictionary.flush called with self.filename.') log.warning('ChannelsDictionary.flush without self.filename.')
def reload(self): def reload(self):
"""Reloads the channel database from its file.""" """Reloads the channel database from its file."""
if self.filename: if self.filename:
self.channels.clear() self.channels.clear()
self.open(self.filename) try:
self.open(self.filename)
except EnvironmentError, e:
log.warning('ChannelsDictionary.reload failed: %s', e)
else: else:
log.warning('ChannelsDictionary.reload called with self.filename.') log.warning('ChannelsDictionary.reload without self.filename.')
def getChannel(self, channel): def getChannel(self, channel):
"""Returns an IrcChannel object for the given channel.""" """Returns an IrcChannel object for the given channel."""