From a66ae845f1f62ab6106c02663d2b191a35c9361f Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:56:38 +0100 Subject: Print-pdf: simplify path detection (#3282) * print-pdf: simplify path detection * i18n: more cleaning up * Version, License paths --- lib/utils/paths.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib/utils/paths.py') diff --git a/lib/utils/paths.py b/lib/utils/paths.py index 10d72de9..2e9faa59 100755 --- a/lib/utils/paths.py +++ b/lib/utils/paths.py @@ -10,14 +10,19 @@ from os.path import dirname, realpath import appdirs -def get_bundled_dir(name): +def get_bundled_dir(name=None): if getattr(sys, 'frozen', None) is not None: if sys.platform == "darwin": - return realpath(os.path.join(sys._MEIPASS, "..", 'Resources', name)) + path = os.path.join(sys._MEIPASS, "..", 'Resources') else: - return realpath(os.path.join(sys._MEIPASS, "..", name)) + path = os.path.join(sys._MEIPASS, "..") else: - return realpath(os.path.join(dirname(realpath(__file__)), '..', '..', name)) + path = os.path.join(dirname(realpath(__file__)), '..', '..') + + if name is not None: + path = os.path.join(path, name) + + return realpath(path) def get_resource_dir(name): -- cgit v1.2.3