From 068b4517ac81c5a128a26ec10153019f1497a2a4 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Wed, 15 Oct 2014 22:50:05 +0200 Subject: move isso.css to journal subdir, use glob.glob instead of listdir --- scripts/bupa | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') 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: -- cgit v1.2.3-70-g09d2