summaryrefslogtreecommitdiff
path: root/lib/utils/inkscape.py
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-05-01 20:37:51 -0400
committerLex Neva <github.com@lexneva.name>2018-05-01 20:37:51 -0400
commit1b31806423c8fec4040fed6d1009db016860b763 (patch)
tree71ccac169471e76685a7fa0b9910f64555dc73a7 /lib/utils/inkscape.py
parent5b7f14d092456a941dbd189e61ed38d9b16d388b (diff)
rename inkstitch/ to lib/
You can't have a module and a package named the same thing. PyInstaller wants to import the main script as if it were a module, and this doesn't work unless there's no directory of the same name with a __init__.py in it.
Diffstat (limited to 'lib/utils/inkscape.py')
-rw-r--r--lib/utils/inkscape.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/utils/inkscape.py b/lib/utils/inkscape.py
new file mode 100644
index 00000000..2d0298bc
--- /dev/null
+++ b/lib/utils/inkscape.py
@@ -0,0 +1,15 @@
+from os.path import realpath, expanduser, join as path_join
+import sys
+
+def guess_inkscape_config_path():
+ if getattr(sys, 'frozen', None):
+ path = realpath(path_join(sys._MEIPASS, "..", "..", ".."))
+ if sys.platform == "win32":
+ import win32api
+
+ # This expands ugly things like EXTENS~1
+ path = win32api.GetLongPathName(path)
+ else:
+ path = expanduser("~/.config/inkscape")
+
+ return path