blob: 005041dd96e88e78dc65397a0b896bc60c54d1ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import os.path
import glob
import sys
def image_path(name):
return os.path.join(resources_dir(), 'images', name)
def converter_scripts():
return glob.glob(os.path.join(resources_dir(), 'converters', '*.py'))
def resources_dir():
if in_py2exe():
directory = os.path.join(os.path.dirname(sys.executable), "resources")
else:
directory = os.path.dirname(__file__)
return os.path.abspath(directory)
def in_py2exe():
return (hasattr(sys,"frozen") and
sys.frozen in ("windows_exe", "console_exe"))
|