aboutsummaryrefslogtreecommitdiffstats
path: root/lvc/resources/__init__.py
blob: 1590cfd033e5dc44d96271a2dc0fff8937ac14f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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"))