From f785d9716758aa4319cef1f12cafaa617fcff471 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 27 Mar 2003 06:57:09 +0000 Subject: [PATCH] Fixed users/channels instantiation to allow for non-existent files --- src/ircdb.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ircdb.py b/src/ircdb.py index 6e97870e1..b0f5529d7 100644 --- a/src/ircdb.py +++ b/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)