diff options
author | Stefan Ritter <xeno@thehappy.de> | 2009-07-06 16:17:42 +0200 |
---|---|---|
committer | Stefan Ritter <xeno@thehappy.de> | 2009-07-06 16:17:42 +0200 |
commit | b60d9c00a74a99cabb7acb145c5e26e290768f36 (patch) | |
tree | 1e89c629471f79e45f48e716b2a404d4d1d70298 | |
parent | be155b1810a806f4ebeba1572109a8989388df03 (diff) |
Regexp that converts underscores in filenames to minus
-rwxr-xr-x | blogthon.cgi | 7 |
1 files 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 ' <div class="entry">' if permalinks: - print ' <div class="entry_title"><a href="?p=' + title + '" class="entry_title">' + title + '</a></div>' + print ' <div class="entry_title"><a href="?p=' + re.sub(' ', '-', title) + '" class="entry_title">' + title + '</a></div>' else: print ' <div class="entry_title">' + title + '</div>' print ' <div class="entry_date">' + date + '</div>' |