mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-10 12:12:33 +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 *
|
from fix import *
|
||||||
|
|
||||||
|
import os
|
||||||
import time
|
import time
|
||||||
import atexit
|
import atexit
|
||||||
import string
|
import string
|
||||||
@ -344,7 +345,16 @@ class ChannelsDictionary(object):
|
|||||||
###
|
###
|
||||||
# Later, I might add some special handling for botnet.
|
# 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)
|
users = UsersDictionary(conf.userfile)
|
||||||
|
|
||||||
|
if not os.path.exists(conf.channelfile):
|
||||||
|
fd = file(conf.channelfile, 'w')
|
||||||
|
fd.write('{}')
|
||||||
|
fd.close()
|
||||||
channels = ChannelsDictionary(conf.channelfile)
|
channels = ChannelsDictionary(conf.channelfile)
|
||||||
|
|
||||||
atexit.register(users.flush)
|
atexit.register(users.flush)
|
||||||
|
Loading…
Reference in New Issue
Block a user