Skip to content

Instantly share code, notes, and snippets.

@WolframRhodium
Last active October 12, 2019 00:00
Show Gist options
  • Save WolframRhodium/3ca2342b7f27904db91bdc7ac4441e28 to your computer and use it in GitHub Desktop.
Save WolframRhodium/3ca2342b7f27904db91bdc7ac4441e28 to your computer and use it in GitHub Desktop.
import vapoursynth as vs
from vapoursynth import core as _vscore
class _Plugin:
def __init__(self, namespace):
self.__dict__.update((name, getattr(namespace, name)) for name in dir(namespace)) # func_name : func
class _Core:
def __init__(self):
self.__dict__.update((name, get_plugin(name)) for name in dir(_vscore)) # (namespace : (func_name : func)) or (attr_name : attr)
def get_plugin(name):
attr = getattr(_vscore, name)
if isinstance(attr, vs.Plugin):
return _Plugin(attr)
else:
return attr
core = _Core()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment