mirror of
https://github.com/dobin/SuperMega
synced 2026-06-02 17:27:10 +00:00
refactor: unify project handling (cmdline = projects/default)
This commit is contained in:
@@ -3,7 +3,9 @@ import os
|
||||
import pathlib
|
||||
import glob
|
||||
import logging
|
||||
import pickle
|
||||
|
||||
from model.project import WebProject
|
||||
from config import config
|
||||
from model.defs import *
|
||||
from observer import observer
|
||||
@@ -13,6 +15,15 @@ logger = logging.getLogger("Helper")
|
||||
SHC_VERIFY_SLEEP = 0.1
|
||||
|
||||
|
||||
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
|
||||
@@ -23,6 +34,7 @@ def clean_tmp_files():
|
||||
for file in files_to_clean:
|
||||
pathlib.Path(file).unlink(missing_ok=True)
|
||||
|
||||
|
||||
def clean_files(settings):
|
||||
logger.info("--( Remove old files")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user