Added more errorhandlers for:
* linklist * entries_dir * staticpages_dir
This commit is contained in:
parent
0f9a7136ff
commit
3100801a07
29
blogthon.cgi
29
blogthon.cgi
@ -32,7 +32,14 @@ def errorpage(string):
|
||||
print ' <title>Error!</title>'
|
||||
print '</head>'
|
||||
print '<body>'
|
||||
print ' <b>' + string + '</b> is not set in configuration, please check your installation!'
|
||||
if string == "entries_dir":
|
||||
print ' Directory <b>"' + entries_dir + '"</b> does not exist!'
|
||||
elif string == "staticpages_dir":
|
||||
print ' Directory <b>"' + staticpages_dir + '"</b> does not exist!'
|
||||
elif string == "linklist":
|
||||
print ' File <b>"linklist"</b> does not exist!'
|
||||
else:
|
||||
print ' <b>' + string + '</b> is not set in configuration, please check your installation!'
|
||||
print '</body>'
|
||||
print '</html>'
|
||||
sys.exit()
|
||||
@ -58,32 +65,52 @@ configuration.read('configuration')
|
||||
|
||||
try: blog_title = configuration.get('personal', 'blog_title')
|
||||
except: errorpage("blog_title")
|
||||
|
||||
try: blog_subtitle = configuration.get('personal', 'blog_subtitle')
|
||||
except: errorpage("blog_subtitle")
|
||||
|
||||
try: blog_url = configuration.get('personal', 'blog_url')
|
||||
except: errorpage("blog_url")
|
||||
|
||||
try: keywords = configuration.get('personal', 'keywords')
|
||||
except: errorpage("keywords")
|
||||
|
||||
try: entries_dir = configuration.get('personal', 'entries_dir')
|
||||
except: errorpage("entries_dir")
|
||||
if not os.path.exists(entries_dir):
|
||||
errorpage("entries_dir")
|
||||
|
||||
try: entries_suffix = configuration.get('personal', 'entries_suffix')
|
||||
except: errorpage("entries_suffix")
|
||||
|
||||
try: staticpages_dir = configuration.get('personal', 'staticpages_dir')
|
||||
except: errorpage("staticpages_dir")
|
||||
if not os.path.exists(staticpages_dir):
|
||||
errorpage("staticpages_dir")
|
||||
|
||||
try: style = configuration.get('look', 'style')
|
||||
except: errorpage("style")
|
||||
|
||||
try: entries_per_page = configuration.getint('look', 'entries_per_page')
|
||||
except: errorpage("entries_per_page")
|
||||
|
||||
try: monthlist = configuration.get('look', 'monthlist')
|
||||
except: errorpage("monthlist")
|
||||
|
||||
try: staticpages = configuration.get('look', 'staticpages')
|
||||
except: errorpage("staticpages")
|
||||
|
||||
try: linklist = configuration.get('look', 'linklist')
|
||||
except: errorpage("linklist")
|
||||
if not os.path.exists("linklist"):
|
||||
errorpage("linklist")
|
||||
|
||||
try: permalinks = configuration.get('look', 'permalinks')
|
||||
except: errorpage("permalinks")
|
||||
|
||||
try: comments = configuration.get('look', 'comments')
|
||||
except: errorpage("comments")
|
||||
|
||||
try: newest_first = configuration.get('look', 'newest_first')
|
||||
except: errorpage("newest_first")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user