summaryrefslogtreecommitdiffstats
path: root/scripts/bupa
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2014-10-15 22:50:05 +0200
committerJohannes Löthberg <johannes@kyriasis.com>2014-10-15 21:59:39 +0100
commit068b4517ac81c5a128a26ec10153019f1497a2a4 (patch)
tree5df5962154c8af595ea5469c1eb930cebb132976 /scripts/bupa
parent8d6b446e48a3fd82cca741644d4b9e53c72c0ebf (diff)
downloadwebsite-068b4517ac81c5a128a26ec10153019f1497a2a4.tar.xz
move isso.css to journal subdir, use glob.glob instead of listdir
Diffstat (limited to 'scripts/bupa')
-rwxr-xr-xscripts/bupa8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/bupa b/scripts/bupa
index 0ed31e6..d0630f5 100755
--- a/scripts/bupa
+++ b/scripts/bupa
@@ -5,7 +5,7 @@ Options:
-h --help Show this screen.
"""
from jinja2 import Environment, FileSystemLoader
-import os, yaml, docopt
+import glob, yaml, docopt
from docutils import core
from docutils.writers.html4css1 import Writer
@@ -48,14 +48,14 @@ def parse(filename):
def build_journal(env):
template = env.get_template('journal.html')
entry_tmpl = env.get_template('entry.html')
- files = os.listdir('src/journal')
+ files = glob.glob('src/journal/*.rst')
files.sort(key=filename_to_id, reverse=True)
entries = []
for file in files:
- entry = parse('src/journal/' + file)
+ entry = parse(file)
entry.id = filename_to_id(file)
- entry.page = 'journal/' + file.split('.', 1)[0] + '.html'
+ entry.page = file.split('/', 1)[1].split('.', 1)[0] + '.html'
entry.body = reST_to_html(entry.body)
entries += [entry]
with open('build/'+entry.page, 'w') as file: