Open ab5424 opened 2 months ago
Yes that would be wise! I was asking myself this question this weekend
If we create a directory outside of the molara install directory, it would be nice to have an uninstaller that cleans it up, right?
A textfile of a few kB shouldn't matter. I don't think other python packages do that either.
How can we move the default.json settings file to that dir upon installation?
How can we move the default.json settings file to that dir upon installation?
We can store the default in the code and overwrite it with custom settings in the user settings file.
Does the "~" operator work in Windows?
Does the "~" operator work in Windows?
Sure. Or Path.home()
.
@ab5424 I created a branch for this, can you please change the installation script in order to create the ~/.molara directory upon installation?
@Michel-Heinz Why no upon startup? Something like
try:
with open(...) as file
settings = json.load(file)
except FileNotFoundError:
settings = _default_settings
os.makedirs("~/molara/", exist_ok=True)
with open("~/molara/settings.json") as file:
json.dump(settings, file)
Okay good idea :+1:
It is not a good idea to save the settings files into the installation path of a library.