Added '../blogthonrc' as alternative configuration

This commit is contained in:
Stefan Ritter 2009-12-06 17:03:28 +01:00
parent e89bbb6bc3
commit d26d49f03c

View File

@ -55,7 +55,15 @@ def document_header(string):
print '<rss version="2.0">' print '<rss version="2.0">'
configuration = ConfigParser.ConfigParser() configuration = ConfigParser.ConfigParser()
# First look for ../blogthonrc and then for ./configuration
if os.path.exists('../blogthonrc'):
configuration.read('../blogthonrc')
elif os.path.exists('configuration'):
configuration.read('configuration') configuration.read('configuration')
else:
errorpage('No suitable configuration found!')
sys.exit()
try: blog_title = configuration.get('personal', 'blog_title') try: blog_title = configuration.get('personal', 'blog_title')
except: errorpage('"blog_title" is missing in configuration!') except: errorpage('"blog_title" is missing in configuration!')