From 46efe19f353d79e0be12da32980ef1457a97d749 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Tue, 24 Nov 2009 13:15:07 -0500 Subject: [PATCH] Remove ugly ternary expression --- geekigeeki.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geekigeeki.py b/geekigeeki.py index 8c9fe64..79dda63 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -612,8 +612,8 @@ class WikiFormatter: print('

') else: indent = indent_re.match(self.line) - #3.0: print(self._indent_to(len(indent.group(0))), end=' ') print(self._indent_to(len(indent.group(1)), indent.group(2))) + # Stand back! Here we apply the monster regex that does all the parsing print(re.sub(scan_re, self.replace, self.line)) if self.in_pre: print('') @@ -666,7 +666,7 @@ class Page: out = '== ' pathname = '' for dirname in self.page_name.strip('/').split('/'): - pathname = (pathname + '/' + dirname) if pathname else dirname + pathname = (pathname and pathname + '/' ) + dirname out += '[[' + pathname + '|' + dirname + ']]/' out += ' ==\n' -- 2.25.1