From b60d9c00a74a99cabb7acb145c5e26e290768f36 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Mon, 6 Jul 2009 16:17:42 +0200 Subject: [PATCH] Regexp that converts underscores in filenames to minus --- blogthon.cgi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/blogthon.cgi b/blogthon.cgi index 3c2df99..7cbda8c 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -123,8 +123,9 @@ except: errorpage("newest_first") # Read POST Variables action = cgi.FieldStorage() month_display = action.getvalue('m') -post_display = action.getvalue('p') static_display = action.getvalue('s') +post_display = action.getvalue('p') +if post_display: post_display = re.sub(' ', '-', post_display) allentries_display = action.getvalue('a') feed_display = action.getvalue('feed') if not month_display: month_display = "" @@ -379,12 +380,12 @@ else: title = title.replace('.' + entries_suffix, '') if month_display == date_to_compare or not month_display: - if post_display == title or not post_display: + if post_display == re.sub(' ', '-', title) or not post_display: if allentries_display == "1" or entry_counter < entries_per_page: content = open(entry, "r") print '
' if permalinks: - print '
' + title + '
' + print '
' + title + '
' else: print '
' + title + '
' print ' '