make extract_scene play nicer with Sublime build system

This commit is contained in:
Ben Hambrecht
2018-05-09 18:23:01 +02:00
parent 7ce5674126
commit d4f3d3c584

View File

@ -151,11 +151,12 @@ def handle_scene(scene, **config):
if config["show_file_in_finder"]:
commands.append("-R")
#
if config["show_last_frame"]:
commands.append(scene.get_image_file_path())
else:
commands.append(scene.get_movie_file_path())
#commands.append("-g")
FNULL = open(os.devnull, 'w')
sp.call(commands, stdout=FNULL, stderr=sp.STDOUT)
FNULL.close()
@ -223,14 +224,18 @@ def get_module_posix(file_name):
module_name = file_name.replace(".py", "")
last_module = imp.load_module(".", *imp.find_module("."))
for part in module_name.split(os.sep):
load_args = imp.find_module(part, last_module.__path__)
last_module = imp.load_module(part, *load_args)
try:
load_args = imp.find_module(part, last_module.__path__)
last_module = imp.load_module(part, *load_args)
except ImportError:
continue
return last_module
def get_module(file_name):
if os.name == 'nt':
return get_module_windows(file_name)
print "file_name =", file_name
return get_module_posix(file_name)