From e4e201408608c6e17a8d87dba9270f77b76ff14f Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Sat, 24 Jul 2010 11:34:19 -0500 Subject: [PATCH] more options loading, debug mode --- dr.botzo.cfg | 3 ++- dr.botzo.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dr.botzo.cfg b/dr.botzo.cfg index 87e2c3f..dacfc90 100644 --- a/dr.botzo.cfg +++ b/dr.botzo.cfg @@ -1,6 +1,7 @@ [IRC] server = irc.foonetic.net port = 6667 -channel = #lh +channel = #bss nick = dr_devzo name = dr. devzo +debug = true diff --git a/dr.botzo.py b/dr.botzo.py index 3e30534..ea552ea 100755 --- a/dr.botzo.py +++ b/dr.botzo.py @@ -23,9 +23,10 @@ def on_connect(connection, event): # read config file -config = ConfigParser() +config = ConfigParser({'debug': 'false'}) config.read([os.path.expanduser('~/.dr.botzo.cfg'), 'dr.botzo.cfg']) +# load necessary options try: # load connection info server = config.get('IRC', 'server') @@ -38,6 +39,9 @@ except NoSectionError as e: except NoOptionError as e: sys.exit("Aborted due to error with necessary configuration: " + str(e)) +# load additional options +irclib.DEBUG = config.getboolean('IRC', 'debug') + # start up the IRC bot # create IRC and server objects and connect