From d26d49f03c6fcf9b80d0a512fe0a3eab05834d71 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Sun, 6 Dec 2009 17:03:28 +0100 Subject: Added '../blogthonrc' as alternative configuration --- blogthon.cgi | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/blogthon.cgi b/blogthon.cgi index 4fb7c52..fe746fb 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -55,7 +55,15 @@ def document_header(string): print '' configuration = ConfigParser.ConfigParser() -configuration.read('configuration') + +# First look for ../blogthonrc and then for ./configuration +if os.path.exists('../blogthonrc'): + configuration.read('../blogthonrc') +elif os.path.exists('configuration'): + configuration.read('configuration') +else: + errorpage('No suitable configuration found!') + sys.exit() try: blog_title = configuration.get('personal', 'blog_title') except: errorpage('"blog_title" is missing in configuration!') -- cgit v1.2.3