summaryrefslogtreecommitdiff
path: root/lib/utils/inkscape.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2022-01-24 13:44:00 +0100
committerGitHub <noreply@github.com>2022-01-24 13:44:00 +0100
commit6ca29b066817af3d666aeb48c6e9713f8a34dc60 (patch)
treec7172f24f53499630e77139bcc259500f5ad5e2f /lib/utils/inkscape.py
parent3514f878ee495e87a4f44cc971de242640fab3d4 (diff)
inkscape config path fallback (#1554)
Diffstat (limited to 'lib/utils/inkscape.py')
-rw-r--r--lib/utils/inkscape.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/utils/inkscape.py b/lib/utils/inkscape.py
index c46bcb6d..58c4ea9b 100644
--- a/lib/utils/inkscape.py
+++ b/lib/utils/inkscape.py
@@ -4,14 +4,21 @@
# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
import sys
-from os.path import expanduser, split
+from os.path import expanduser, realpath, split
from inkex.utils import get_user_directory
def guess_inkscape_config_path():
if getattr(sys, 'frozen', None):
- path = split(get_user_directory())[0]
+ if get_user_directory() is not None:
+ path = split(get_user_directory())[0]
+ else:
+ path = realpath(sys._MEIPASS.split('extensions', 1)[0])
+ if sys.platform == "win32":
+ import win32api
+ # This expands ugly things like EXTENS~1
+ path = win32api.GetLongPathName(path)
else:
path = expanduser("~/.config/inkscape")
return path