diff --git a/Nagstamon/Config.py b/Nagstamon/Config.py index 59ea68aa..0870afe3 100644 --- a/Nagstamon/Config.py +++ b/Nagstamon/Config.py @@ -1062,11 +1062,17 @@ def __init__(self, **kwds): executable_dir = os.path.join(os.sep.join(sys.executable.split(os.sep)[:-1])) if os.path.exists(os.path.normcase(os.sep.join((executable_dir, "resources")))): RESOURCES = os.path.normcase(os.sep.join((executable_dir, "resources"))) + + print('resources 1: ' + RESOURCES) + else: import pkg_resources RESOURCES = pkg_resources.resource_filename("Nagstamon", "resources") + print('resources 2: ' + RESOURCES) + + except Exception as err: # get resources directory from current directory - only if not being set before by pkg_resources # try-excepts necessary for platforms like Windows .EXE @@ -1096,6 +1102,10 @@ def __init__(self, **kwds): for path in paths_to_check: if os.path.exists(path): RESOURCES = path + print('resources 3: ' + RESOURCES, paths_to_check) + break else: RESOURCES = str(Path(__file__).parent.absolute().joinpath('resources')) + + print('resources 4: ' + RESOURCES)