web ui - mostly finished templating integration (needs some testing)

This commit is contained in:
bunkerity
2021-06-01 15:22:03 +02:00
parent 7323525b69
commit ee178de6ab
16 changed files with 141 additions and 50 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/python3
import argparse, os, sys
import argparse, os, sys, shutil
import utils
from Configurator import Configurator
@@ -51,6 +51,14 @@ if __name__ == "__main__" :
config = configurator.get_config()
print(config)
# Remove old config
for filename in os.listdir(args.output):
file_path = os.path.join(args.output, filename)
if os.path.isfile(file_path) or os.path.islink(file_path):
os.unlink(file_path)
elif os.path.isdir(file_path):
shutil.rmtree(file_path)
# Generate the files from templates and config
templator = Templator(config, args.templates, args.output, args.target)
templator.render_global()