mirror of
https://github.com/dobin/SuperMega
synced 2026-06-02 17:27:10 +00:00
refactor: make web work again (split project <-> settings)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user