summaryrefslogtreecommitdiff
path: root/bin/chroma-cam
diff options
context:
space:
mode:
Diffstat (limited to 'bin/chroma-cam')
-rwxr-xr-xbin/chroma-cam9
1 files changed, 3 insertions, 6 deletions
diff --git a/bin/chroma-cam b/bin/chroma-cam
index 8465aaa..6e52387 100755
--- a/bin/chroma-cam
+++ b/bin/chroma-cam
@@ -4,7 +4,6 @@
if __name__ == '__main__':
import optparse
import sys
- import imp
import os
from chroma import view, build, EventViewer
@@ -24,16 +23,14 @@ if __name__ == '__main__':
if os.path.exists(args[0]) and args[0].lower().endswith(('.stl', '.bz2')):
obj = mesh_from_stl(args[0])
else:
- name, attr = args[0].split('.')
+ module_name, function_name = args[0].rsplit('.', 1)
try:
- file, path, description = imp.find_module(name)
+ module = __import__(module_name, fromlist=[function_name])
except ImportError:
raise
- module = imp.load_module(name, file, path, description)
-
- obj = getattr(module, attr)
+ obj = getattr(module, function_name)
if options.io_file is None:
view(obj, size)