1
0
Fork 0

remove need to change vars in src/constatnts.py

This commit is contained in:
Kim, Jimin 2022-07-01 14:15:53 +09:00
parent 8bf971e4f1
commit 4951255424
2 changed files with 10 additions and 12 deletions

View file

@ -1,9 +1,12 @@
# must be synced with `setup.py`
# this variable may be altered by the script
# most notably by `src/interface/choose_action.py`
from os import environ from os import environ
from os.path import abspath, dirname
# used to look for resources
# points to repo root
content_dir = abspath(dirname(dirname(__file__)))
# used to temporarily save files
# must be synced with `setup.py`
tmp_dir = "/tmp/com.developomp.setup"
content_dir = "/tmp/com.developomp.setup"
tmp_dir = content_dir
home_dir = environ.get("HOME") home_dir = environ.get("HOME")

View file

@ -4,15 +4,10 @@ from os.path import exists, abspath
from src.util import import_file from src.util import import_file
from src.log import log from src.log import log
import src.constants from src.constants import content_dir
def choose_action(): def choose_action():
if exists(".git/") and exists("src/"):
src.constants.content_dir = abspath(".")
content_dir = src.constants.content_dir
files = glob(f"{content_dir}/src/setup/**/*.py") files = glob(f"{content_dir}/src/setup/**/*.py")
files = [ files = [
s.removeprefix(f"{content_dir}/src/setup/") s.removeprefix(f"{content_dir}/src/setup/")