aboutsummaryrefslogtreecommitdiffstats
path: root/lvc/resources/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'lvc/resources/__init__.py')
-rw-r--r--lvc/resources/__init__.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/lvc/resources/__init__.py b/lvc/resources/__init__.py
new file mode 100644
index 0000000..005041d
--- /dev/null
+++ b/lvc/resources/__init__.py
@@ -0,0 +1,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"))