inkscape config path fallback (#1554)

pull/1577/head
Kaalleen 2022-01-24 13:44:00 +01:00 zatwierdzone przez GitHub
rodzic 3514f878ee
commit 6ca29b0668
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -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