From 921d2a6d6200bb46a6f967f6a3f08fa50fa1eb74 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 12 Feb 2013 17:47:17 +0100 Subject: [PATCH] fix the typo about CDN instead of cnd --- kompost/generate.py | 2 +- kompost/generators/rst.py | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/kompost/generate.py b/kompost/generate.py index 7aa3319..7171ccf 100644 --- a/kompost/generate.py +++ b/kompost/generate.py @@ -49,7 +49,7 @@ def generate(config): cats = [cat.strip() for cat in cats if cat.strip() != ''] config['categories'] = cats - for path in ('cnd', 'siteurl'): + for path in ('cdn', 'siteurl'): if os.path.exists(config[path]): config[path] = os.path.abspath(config[path]) diff --git a/kompost/generators/rst.py b/kompost/generators/rst.py index ceac167..95c813b 100644 --- a/kompost/generators/rst.py +++ b/kompost/generators/rst.py @@ -16,11 +16,11 @@ _FOOTER = """ -.. |pen| image:: %(cnd)s/media/pen.png -.. |info| image:: %(cnd)s/media/info.png -.. |thumbsup| image:: %(cnd)s/media/thumbsup.png -.. |right| image:: %(cnd)s/media/right.png -.. |flash| image:: %(cnd)s/media/flash.png +.. |pen| image:: %(cdn)s/media/pen.png +.. |info| image:: %(cdn)s/media/info.png +.. |thumbsup| image:: %(cdn)s/media/thumbsup.png +.. |right| image:: %(cdn)s/media/right.png +.. |flash| image:: %(cdn)s/media/flash.png .. |infosign| image:: icon-info-sign """ @@ -66,7 +66,7 @@ def render_simple_tag(node, document, title, config, tagname=None, def _tree(node, document, title, config): """Renders a node in HTML. """ - cnd = config['cnd'] + cdn = config['cdn'] text = [] klass = node.__class__.__name__ if klass == 'transition': @@ -207,7 +207,7 @@ def _tree(node, document, title, config): text.append('' % refuri) if not uri.startswith('http'): - uri = '/'.join([config['cnd'], document.split('/')[1], uri]) + uri = '/'.join([config['cdn'], document.split('/')[1], uri]) text.append('' % uri) # caption @@ -274,7 +274,7 @@ def _tree(node, document, title, config): index(document, title, 'author', value) author_id = str2authorid(value) text.append('' % cnd) + 'src="%s/media/pen.png">' % cdn) text.append('') text.append('%s' % (config['siteurl'], author_id, value)) @@ -286,7 +286,7 @@ def _tree(node, document, title, config): value = node.children[1].astext() if name == 'category': text.append('' % cnd) + 'src="%s/media/info.png">' % cdn) text.append('') cats = value.split(',') index(document, title, name, cats) @@ -299,14 +299,14 @@ def _tree(node, document, title, config): index(document, title, name, value) text.append('' % cnd) + 'src="%s/media/flash.png">' % cdn) text.append('') text.append('Niveau: %s' % value.capitalize()) elif name == 'translator': index(document, title, name, value) text.append('' % cnd) + 'src="%s/media/translation.png">' % cdn) text.append('') author_id = str2authorid(value) msg = ('Traduction: ' @@ -343,7 +343,7 @@ def __call__(self, path, target, url_target, **options): target = os.path.splitext(target)[0] + '.html' with open(path) as f: - content = f.read() + _FOOTER % {'cnd': self.config['cnd']} + content = f.read() + _FOOTER % {'cdn': self.config['cdn']} doctree = publish_doctree(content) title = doctree.children[0].astext()