mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-09 11:42:35 +01:00
Fixed users/channels instantiation to allow for non-existent files
This commit is contained in:
parent
0663267ba3
commit
f785d97167
10
src/ircdb.py
10
src/ircdb.py
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user