diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/template.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/scripts/template.py b/scripts/template.py index 748df8c..a4d4e9e 100755 --- a/scripts/template.py +++ b/scripts/template.py @@ -13,15 +13,13 @@ from string import Template import ConfigParser def readdir(directory): + return_value = {"content.html":"", "keywords":"", "desc_de":"", "desc_en":""} - global content - content= {"content.html":"", "keywords":"", "desc_de":"", "desc_en":""} - - for c in content: + for c in return_value: f = open(os.path.join(directory, c), "r") - content[c] = f.read() + return_value[c] = f.read() f.close - + return return_value def substitute(target, prefix, htmltemplate, datenow, topic, content): @@ -110,8 +108,8 @@ if verbose: for page in os.listdir(pagepath): prefix = os.path.join(pagepath, page) - readdir(prefix) - substitute(target, prefix, htmltemplate, datenow, topic, content) + page_data = readdir(prefix) + substitute(target, prefix, htmltemplate, datenow, topic, page_data) if verbose: print "%s.html written" % prefix # vi: noexpandtab:tabstop=8:shiftwidth=8 |