From 157651f5c13efba2286751c36fd15911f794ab76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eli=C3=A1n=20Hanisch?= Date: Thu, 5 Jul 2012 18:20:47 -0300 Subject: [PATCH] minor tweaks for bans.cgi --- Bantracker/cgi/bans.cgi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Bantracker/cgi/bans.cgi b/Bantracker/cgi/bans.cgi index 99a6095..c5d1873 100755 --- a/Bantracker/cgi/bans.cgi +++ b/Bantracker/cgi/bans.cgi @@ -33,7 +33,10 @@ config.set('webpage', 'irc_channel', '#ubuntu-ops') try: config.readfp(open(CONFIG_FILENAME)) except IOError: - config.write(open(CONFIG_FILENAME, 'w')) + try: + config.write(open(CONFIG_FILENAME, 'w')) + except IOError: + pass # This needs to be set to the location of the commoncgi.py file PLUGIN_PATH = config.get('webpage', 'PLUGIN_PATH') @@ -46,7 +49,7 @@ except: print "Content-Type: text/html" print print "

Failed to load the module commoncgi

" - print "

Check that the config option PLUGIN_PATH in '%s' is correct.

" % CONFIG_FILENAME ##< Is this "private" information? + print "

Check that the configured option PLUGIN_PATH is correct.

" sys.exit(-1) db = config.get('webpage', 'database')