2021-03-12 04:17:19 +00:00
|
|
|
# Authors: see git history
|
|
|
|
#
|
|
|
|
# Copyright (c) 2010 Authors
|
|
|
|
# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
|
|
|
|
|
2018-04-21 02:49:05 +00:00
|
|
|
import sys
|
2021-03-04 17:40:53 +00:00
|
|
|
from os.path import expanduser, realpath
|
2018-04-21 02:49:05 +00:00
|
|
|
|
2018-08-22 00:32:50 +00:00
|
|
|
|
2018-04-21 02:49:05 +00:00
|
|
|
def guess_inkscape_config_path():
|
|
|
|
if getattr(sys, 'frozen', None):
|
2021-03-04 17:40:53 +00:00
|
|
|
path = realpath(sys._MEIPASS.split('extensions', 1)[0])
|
2018-04-26 00:55:17 +00:00
|
|
|
if sys.platform == "win32":
|
|
|
|
import win32api
|
|
|
|
|
|
|
|
# This expands ugly things like EXTENS~1
|
|
|
|
path = win32api.GetLongPathName(path)
|
2018-04-21 02:49:05 +00:00
|
|
|
else:
|
|
|
|
path = expanduser("~/.config/inkscape")
|
|
|
|
|
|
|
|
return path
|