import sys import os def load(path): f = open(path) return f.read() def prepare(config): config = config.splitlines() out = f"""

{config[0]}

{config[2]}

""" return(out) groups = os.listdir(f"{os.path.dirname(sys.argv[0])}/services") html = "" for i in groups: items = os.listdir(f"{os.path.dirname(sys.argv[0])}/services/{i}") html = html + f"""

{i}

""" for a in items: temp = load(f"{os.path.dirname(sys.argv[0])}/services/{i}/{a}") html = html + prepare(temp) html = html + "
" css = open(f"{os.path.dirname(sys.argv[0])}/template/temp.css") html = f"""

My ok ish dashboard

{html} """ f = open(f"{os.path.dirname(sys.argv[0])}/render/render.html","w") f.write(html) port = 1111 try: exec(open(f"{os.path.dirname(sys.argv[0])}/run.py").read()) except OSError as error: if error.errno == 98: print(f"recompiled, another service or instance of this server is running on port {port}") print("if this server is running, it will have the current config") else: print(f"unexpected error: '{error}'")