Fixed users/channels instantiation to allow for non-existent files

This commit is contained in:
Jeremy Fincher 2003-03-27 06:57:09 +00:00
parent 0663267ba3
commit f785d97167
1 changed files with 10 additions and 0 deletions

View File

@ -31,6 +31,7 @@
from fix import *
import os
import time
import atexit
import string
@ -344,7 +345,16 @@ class ChannelsDictionary(object):
###
# Later, I might add some special handling for botnet.
###
if not os.path.exists(conf.userfile):
fd = open(conf.userfile, 'w')
fd.write('{}')
fd.close()
users = UsersDictionary(conf.userfile)
if not os.path.exists(conf.channelfile):
fd = file(conf.channelfile, 'w')
fd.write('{}')
fd.close()
channels = ChannelsDictionary(conf.channelfile)
atexit.register(users.flush)