aboutsummaryrefslogtreecommitdiffstats
path: root/blogthon.cgi
diff options
context:
space:
mode:
authorStefan Ritter <xeno@goliath.thehappy.de>2009-05-22 10:18:04 +0200
committerStefan Ritter <xeno@goliath.thehappy.de>2009-05-22 10:18:04 +0200
commit3100801a071ce141cae0c0f782458de814cde2d4 (patch)
treeb88bb97655ec3c1fb5a0bcc64e354250348183a2 /blogthon.cgi
parent0f9a7136ff2e83c391091f23231fe42b0ca31576 (diff)
Added more errorhandlers for:
* linklist * entries_dir * staticpages_dir
Diffstat (limited to 'blogthon.cgi')
-rwxr-xr-xblogthon.cgi29
1 files changed, 28 insertions, 1 deletions
diff --git a/blogthon.cgi b/blogthon.cgi
index cac3b92..69cdd48 100755
--- a/blogthon.cgi
+++ b/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")