refactor: make web work again (split project <-> settings)

This commit is contained in:
Dobin Rutishauser
2025-06-18 21:24:35 +02:00
parent fcb40ccb6a
commit 6864656381
20 changed files with 214 additions and 349 deletions
+5 -14
View File
@@ -6,7 +6,7 @@ import logging
import pickle
import math
from model.project import WebProject
from model.project import Project
from config import config
from model.defs import *
from observer import observer
@@ -16,15 +16,6 @@ logger = logging.getLogger("Helper")
SHC_VERIFY_SLEEP = 0.2
def write_webproject(project_name, settings):
filepath = "{}project.pickle".format(settings.main_dir)
logger.info("Write project to: {}".format(filepath))
webProject = WebProject(project_name, settings)
webProject.comment = "Created by command line interface"
with open(filepath, "wb") as f:
pickle.dump(webProject, f)
def clean_tmp_files():
files_to_clean = [
# compile artefacts in current working dir
@@ -39,10 +30,10 @@ def clean_tmp_files():
def clean_files(settings):
files_to_clean = [
# temporary files
settings.main_c_path,
settings.main_asm_path,
settings.main_shc_path,
settings.main_exe_path,
settings.project_c_path,
settings.project_asm_path,
settings.project_shc_path,
settings.project_exe_path,
]
for file in files_to_clean:
pathlib.Path(file).unlink(missing_ok=True)