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 # function that
# 1) checks if folder has been specified by user # checks if one has been in use before and writes it to dict/config
# 2) if not, 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
# 3) if not, determines which to use and writes it to dict/config
# returns determined folder # returns determined folder
def find_good_folder(datatype,configobject): def find_good_folder(datatype,configobject):
info = directory_info[datatype] info = directory_info[datatype]
@ -110,9 +109,13 @@ else:
found_new_config_dir = False found_new_config_dir = False
# remember whether we had to find our config dir or it was user-specified # 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") oldsettingsfile = pthj(maloja_dir_config,"settings","settings.ini")
newsettingsfile = pthj(maloja_dir_config,"settings.ini") newsettingsfile = pthj(maloja_dir_config,"settings.ini")
if os.path.exists(oldsettingsfile): if os.path.exists(oldsettingsfile):
os.rename(oldsettingsfile,newsettingsfile) os.rename(oldsettingsfile,newsettingsfile)
@ -225,6 +228,8 @@ for datatype in ("state","cache","logs"):
### STEP 4 - this is where all the guessing about previous installation ends ### STEP 4 - this is where all the guessing about previous installation ends
### we have our definite settings and are now just generating the real ### we have our definite settings and are now just generating the real
### folder names for everything ### folder names for everything

View File

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