aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Ritter <xeno@thehappy.de>2009-10-30 15:18:58 +0100
committerStefan Ritter <xeno@thehappy.de>2009-10-30 15:18:58 +0100
commita8f13c725ecfac7fe06d0d05b0154bb88db4ac0a (patch)
tree18534ea7ca02a75819c01e20682bdcf88fb03f1d
parentaea159f1413afbfb8d7aa84cc6e3a19d17456d42 (diff)
Really fixed now ;)
-rwxr-xr-xblogthon.cgi23
1 files changed, 9 insertions, 14 deletions
diff --git a/blogthon.cgi b/blogthon.cgi
index b7f54ec..9eb2ab6 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -332,21 +332,16 @@ else:
print ' <div class="pages_list">'
print ' <ul class="pages_list">'
for staticpage in staticpages_list:
- f = open(staticpage, 'r')
- for line in f:
- if line.split(':', 1)[0] == 'extern_link':
- link = ''
- extern_link = line.split(':', 1)[1].strip()
- else:
- link = re.sub('\w+?\/', '', staticpage)
- extern_link = ''
- break
- f.close()
- title = re.sub('\w+?\/\d+?-', '', staticpage)
- if extern_link:
- print ' <li class="pages_list_entry"><a href=' + link + '" class="pages_list_entry">' + extern_link + '</a></li>'
+ file = open(staticpage, 'r')
+ header = file.readline()
+ if header.split(':', 1)[0] == 'extern_link':
+ link = header.split(':', 1)[1].strip()
else:
- print ' <li class="pages_list_entry"><a href="?s=' + link + '" class="pages_list_entry">' + title + '</a></li>'
+ link = re.sub('\w+?\/', '', staticpage)
+ link = '?s=' + link
+ file.close()
+ title = re.sub('\w+?\/\d+?-', '', staticpage)
+ print ' <li class="pages_list_entry"><a href="' + link + '" class="pages_list_entry">' + title + '</a></li>'
print ' </ul>'
print ' </div>'
print ' <div class="pages_footer"></div>'