Last active
October 12, 2019 00:00
-
-
Save WolframRhodium/3ca2342b7f27904db91bdc7ac4441e28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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