mirror of
https://github.com/krateng/maloja.git
synced 2025-07-09 03:04:07 -04:00
Dev scripts
This commit is contained in:
parent
ffed0c29b0
commit
767a6bca26
3
dev/clear_testdata.sh
Normal file
3
dev/clear_testdata.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
sudo rm -r ./testdata
|
||||||
|
mkdir ./testdata
|
||||||
|
chmod 777 ./testdata
|
@ -7,15 +7,15 @@ import os
|
|||||||
import jinja2
|
import jinja2
|
||||||
|
|
||||||
env = jinja2.Environment(
|
env = jinja2.Environment(
|
||||||
loader=jinja2.FileSystemLoader('dev/templates'),
|
loader=jinja2.FileSystemLoader('./templates'),
|
||||||
autoescape=jinja2.select_autoescape(['html', 'xml']),
|
autoescape=jinja2.select_autoescape(['html', 'xml']),
|
||||||
keep_trailing_newline=True
|
keep_trailing_newline=True
|
||||||
)
|
)
|
||||||
|
|
||||||
with open("pyproject.toml") as filed:
|
with open("../pyproject.toml") as filed:
|
||||||
data = toml.load(filed)
|
data = toml.load(filed)
|
||||||
|
|
||||||
templatedir = "./dev/templates"
|
templatedir = "./templates"
|
||||||
|
|
||||||
for root,dirs,files in os.walk(templatedir):
|
for root,dirs,files in os.walk(templatedir):
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ for root,dirs,files in os.walk(templatedir):
|
|||||||
if not f.endswith('.jinja'): continue
|
if not f.endswith('.jinja'): continue
|
||||||
|
|
||||||
srcfile = os.path.join(root,f)
|
srcfile = os.path.join(root,f)
|
||||||
trgfile = os.path.join(reldirpath,f.replace(".jinja",""))
|
trgfile = os.path.join("..", reldirpath,f.replace(".jinja",""))
|
||||||
|
|
||||||
|
|
||||||
template = env.get_template(relfilepath)
|
template = env.get_template(relfilepath)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user