Updated again.

This commit is contained in:
Jeremy Fincher 2004-02-06 04:14:37 +00:00
parent 92a7ae1028
commit dce0378a8c

View File

@ -18,6 +18,7 @@ class IrcUser:
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
IrcChannel = IrcUser
UserCapabilitySet = list
CapabilitySet = list
@ -28,6 +29,7 @@ def write(fd, s):
if __name__ == '__main__':
shutil.copy(userFile, userFile + '.bak')
shutil.copy(channelFile, channelFile + '.bak')
try:
# Users.conf.
fd = file(userFile)
s = fd.read().strip()
@ -45,7 +47,7 @@ if __name__ == '__main__':
for capability in u.capabilities:
try:
(channel, capability) = rsplit(capability, '.', 1)
capability = ','.join(channel, capability)
capability = ','.join([channel, capability])
except ValueError:
pass
write(fd, ' capability %s' % capability)
@ -70,4 +72,8 @@ if __name__ == '__main__':
for ignore in c.ignores:
write(fd, ' ignore %s' % ignore)
write(fd, '')
except Exception, e:
print 'Exception raised, restoring backups.'
shutil.copy(userFile + '.bak', userFile)
shutil.copy(channelFile + '.bak', channelFile)
raise