ui - various bug fixes more or less related to UI

This commit is contained in:
florian
2021-08-09 13:19:10 +02:00
parent 2ec28c79cb
commit bcd421de09
10 changed files with 38 additions and 22 deletions

View File

@@ -50,10 +50,18 @@ class Templator :
real_config["ROOT_FOLDER"] += "/" + real_config["ROOT_SITE_SUBFOLDER"]
return real_config
def __filter_var(self, variable) :
filters = ["FIRST_SERVER", "NGINX_PREFIX"]
for filter in filters :
if variable == filter or variable.endswith("_" + filter) :
return True
return False
def __save_config(self, type, config) :
data = ""
for variable, value in config.items() :
data += variable + "=" + value + "\n"
if not self.__filter_var(variable) :
data += variable + "=" + value + "\n"
file = self.__output_path
if type == "global" :
file += "/global.env"

View File

@@ -3,7 +3,7 @@ def load_variables(path) :
with open(path) as f :
lines = f.read().splitlines()
for line in lines :
if line.startswith("#") :
if line.startswith("#") or line == "" or not "=" in line :
continue
var = line.split("=")[0]
value = line[len(var)+1:]