1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00
This commit is contained in:
krateng 2021-12-23 07:24:24 +01:00
parent 4aa1343cf1
commit 06f178b58a
2 changed files with 9 additions and 4 deletions

View File

@ -70,9 +70,8 @@ directory_info = {
}
# function that
# 1) checks if folder has been specified by user
# 2) if not, checks if one has been in use before and writes it to dict/config
# 3) if not, determines which to use and writes it to dict/config
# checks if one has been in use before and writes it to dict/config
# if not, determines which to use and writes it to dict/config
# returns determined folder
def find_good_folder(datatype,configobject):
info = directory_info[datatype]
@ -110,9 +109,13 @@ else:
found_new_config_dir = False
# remember whether we had to find our config dir or it was user-specified
os.makedirs(maloja_dir_config,exist_ok=True)
oldsettingsfile = pthj(maloja_dir_config,"settings","settings.ini")
newsettingsfile = pthj(maloja_dir_config,"settings.ini")
if os.path.exists(oldsettingsfile):
os.rename(oldsettingsfile,newsettingsfile)
@ -220,6 +223,8 @@ for datatype in ("state","cache","logs"):
if malojaconfig.get_specified(directory_info[datatype]['setting']) is None and malojaconfig.get_specified('DATA_DIRECTORY') is None:
find_good_folder(datatype,malojaconfig)

View File

@ -31,7 +31,7 @@ dependencies = [
]
[project.scripts]
maloja = "proccontrol.control:main"
maloja = "maloja.proccontrol.control:main"
[build-system]
requires = ["flit_core >=3.2,<4"]