summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2011-11-05 02:23:26 +0100
committerGravatar Tom Willemsen2011-11-05 02:23:26 +0100
commit186d47fe849e03766427557a14ea1cd44c2c5623 (patch)
tree7284b79649a07bd73711923aa0f5da42a3c0eb54
parentf426a2f8efd7b91219e28514976a11ec55e4bf28 (diff)
downloaddotfiles-186d47fe849e03766427557a14ea1cd44c2c5623.tar.gz
dotfiles-186d47fe849e03766427557a14ea1cd44c2c5623.zip
Only check time if it exists
-rw-r--r--pages/management/commands/parse_markdown.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/pages/management/commands/parse_markdown.py b/pages/management/commands/parse_markdown.py
index 105b004..500087a 100644
--- a/pages/management/commands/parse_markdown.py
+++ b/pages/management/commands/parse_markdown.py
@@ -18,9 +18,9 @@ class Command(BaseCommand):
htmlpath = '%s/templates/html_pages/%s' % (DEPLOY_PATH, mdname)
htmlfile = '%s/index.html' % htmlpath
- if mdtuple[1] == '.mdwn' \
- and os.path.exists(mdfile) and not os.path.exists(htmlfile) \
- or os.path.getmtime(mdfile) > os.path.getmtime(htmlfile):
+ if mdtuple[1] == '.mdwn' and os.path.exists(mdfile) \
+ and (not os.path.exists(htmlfile) \
+ or os.path.getmtime(mdfile) > os.path.getmtime(htmlfile)):
if not os.path.exists(htmlpath):
os.makedirs(htmlpath)
@@ -28,8 +28,7 @@ class Command(BaseCommand):
md = markdown.Markdown()
print 'Converting ', mdname, '-->', htmlfile,
wikiExtension = 'wikilinks(base_url=%s/)' % subdir
- markdown.markdownFromFile(input=mdfile, output=htmlfile,
- encoding="utf-8",
+ markdown.markdownFromFile(input=mdfile, output=htmlfile, encoding="utf-8",
extensions=[wikiExtension])
print ' ... succeeded'