Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
})
except Exception: # pylint: disable=broad-except
self.script_exec_failed = True
logging.error(
'Script contains error(s). Check following lines for details.')
self.handle_script_error(
'Script contains error(s). See console output for details.')
print_exc()
return
finally:
sys.argv = argv_orig
sys.path.pop()
self.script_exec_failed = False
if len(vs.get_outputs()) == 0:
logging.error('Script has no outputs set.')
self.handle_script_error('Script has no outputs set.')
return
self.toolbars.main.rescan_outputs()
# self.init_outputs()
self.switch_output(self.OUTPUT_INDEX)
self.load_storage()
def get_global_outputs():
import vapoursynth
if hasattr(vapoursynth, "get_outputs"):
return vapoursynth.get_outputs()
return types.MappingProxyType(vapoursynth._get_output_dict("OutputManager.get_outputs"))
def __init__(self, local_storage: Optional[Mapping[str, Output]] = None) -> None:
super().__init__()
self.items: List[Output] = []
local_storage = local_storage if local_storage is not None else {}
for i, vs_output in vs.get_outputs().items():
try:
output = local_storage[str(i)]
output.__init__(vs_output, i) # type: ignore
except KeyError:
output = Output(vs_output, i)
self.items.append(output)
def vs_clear_cache() -> None:
import vapoursynth as vs
cache_size = vs.core.max_cache_size
vs.core.max_cache_size = 1
output = list(vs.get_outputs().values())[0]
if isinstance(output, vs.AlphaOutputTuple):
output = output.clip
output.get_frame(0)
vs.core.max_cache_size = cache_size