summaryrefslogtreecommitdiffstats
path: root/scripts/jinjify.py
diff options
context:
space:
mode:
authorLibravatarAgustin Henze <tin@sluc.org.ar>2015-07-08 07:35:02 -0300
committerLibravatarAgustin Henze <tin@sluc.org.ar>2015-07-08 07:35:02 -0300
commitb0b24795b24ee6809397fbbadf42f31f310a219f (patch)
tree46d05bb47460b4ec679211717c4ab07414b80d9c /scripts/jinjify.py
parent5ec02211214350ee558fd9f6bb052264fd24f75e (diff)
Imported Upstream version 7.6.0upstream/7.6.0
Diffstat (limited to 'scripts/jinjify.py')
-rwxr-xr-xscripts/jinjify.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/scripts/jinjify.py b/scripts/jinjify.py
index be69731..30f8029 100755
--- a/scripts/jinjify.py
+++ b/scripts/jinjify.py
@@ -22,6 +22,7 @@ dumb_replacements = [
]
dumber_replacements = [
+ ['<%! import json %>\n\n', ''],
["<html\n\\", "<html\n"],
["\n'\\\n", "\n'\n"],
["{% endif %}\n\\", "{% endif %}\n"]
@@ -76,15 +77,18 @@ def jinjify(in_theme, out_theme):
if child in mappings:
parent = mappings[child]
- with open(os.path.join(out_theme, "parent"), "wb+") as outf:
- outf.write(parent + '\n')
+ with io.open(os.path.join(out_theme, "parent"), "w+", encoding='utf-8') as outf:
+ outf.write(u'{0}\n'.format(parent))
- with open(os.path.join(out_theme, "engine"), "wb+") as outf:
- outf.write("jinja\n")
+ with io.open(os.path.join(out_theme, "engine"), "w+", encoding='utf-8') as outf:
+ outf.write(u"jinja\n")
- # Copy assets
- # shutil.rmtree(os.path.join(out_theme, "assets"))
- # shutil.copytree(os.path.join(in_theme, "assets"), os.path.join(out_theme, "assets"))
+ # Copy assets in bootstrap/bootstrap3
+ if child in ('bootstrap-jinja', 'bootstrap3-jinja'):
+ shutil.rmtree(os.path.join(out_theme, "assets"))
+ shutil.copytree(
+ os.path.join(in_theme, "assets"), os.path.join(out_theme, "assets"),
+ symlinks=True)
# Copy bundles
# shutil.copy(os.path.join(in_theme, "bundles"), os.path.join(out_theme, "bundles"))