From 0e339111f1976bee95ec4a15c285ab270889fc5f Mon Sep 17 00:00:00 2001 From: A_D Date: Sun, 22 Nov 2020 16:13:47 +0200 Subject: [PATCH] Made sure to grab the correct dir for paths on windows --- config.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/config.py b/config.py index 371b0234..2364f519 100644 --- a/config.py +++ b/config.py @@ -308,7 +308,7 @@ class AbstractConfig(abc.ABC): class WinConfig(AbstractConfig): """Implementation of AbstractConfig for windows.""" - def __init__(self) -> None: + def __init__(self, do_winsparkle=True) -> None: self.app_dir = pathlib.Path(str(known_folder_path(FOLDERID_LocalAppData))) / appname self.app_dir.mkdir(exist_ok=True) @@ -316,11 +316,11 @@ class WinConfig(AbstractConfig): self.plugin_dir.mkdir(exist_ok=True) if getattr(sys, 'frozen', False): - self.respath = pathlib.Path(dirname(sys.executable)) + self.respath = pathlib.Path(sys.executable).parent self.internal_plugin_dir = self.respath / 'plugins' else: - self.respath = pathlib.Path(dirname(__file__)) + self.respath = pathlib.Path(__file__).parent self.internal_plugin_dir = self.respath / 'plugins' self.home = pathlib.Path.home() @@ -384,11 +384,6 @@ class WinConfig(AbstractConfig): winsparkle_reg.Close() edcd_handle.Close() - self.identifier = applongname - if (outdir_str := self.get_str('outdir')) is None or not isdir(outdir_str): - docs = known_folder_path(FOLDERID_Documents) - self.set('outdir', docs if docs is not None else str(self.home)) - def __get_regentry(self, key: str) -> Union[None, list, str, int]: """Access the registry for the raw entry.""" try: