mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-19 02:17:38 +03:00
Made sure to grab the correct dir for paths on windows
This commit is contained in:
parent
b3cc94031b
commit
0e339111f1
11
config.py
11
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user