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