diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-07-04 21:16:49 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-07-12 20:13:46 -0400 |
| commit | d090fa003830f117918fac201ca527d513507a70 (patch) | |
| tree | 4cf3bb9462c6c083b2ab97d493f8607733a5f9fd /lib/utils | |
| parent | a0659e2c2d7609294c1a5a70153b1aa647595e94 (diff) | |
move get_bundled_dir to utils
Diffstat (limited to 'lib/utils')
| -rw-r--r-- | lib/utils/__init__.py | 1 | ||||
| -rw-r--r-- | lib/utils/paths.py | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/utils/__init__.py b/lib/utils/__init__.py index ff06d4a9..78d037f1 100644 --- a/lib/utils/__init__.py +++ b/lib/utils/__init__.py @@ -2,3 +2,4 @@ from geometry import * from cache import cache from io import * from inkscape import * +from paths import * diff --git a/lib/utils/paths.py b/lib/utils/paths.py new file mode 100644 index 00000000..863e8e69 --- /dev/null +++ b/lib/utils/paths.py @@ -0,0 +1,10 @@ +import sys +import os +from os.path import dirname, realpath + + +def get_bundled_dir(name): + if getattr(sys, 'frozen', None) is not None: + return realpath(os.path.join(sys._MEIPASS, "..", name)) + else: + return realpath(os.path.join(dirname(realpath(__file__)), '..', '..', name)) |
