How to use the ptype.source function in ptype

To help you get started, we’ve selected a few ptype examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github arizvisa / syringe / lib / ptypes / config.py View on Github external
def __setsource(value):
        global ptype
        if all(hasattr(value, method) for method in ('seek','store','consume')) or isinstance(value, provider.base):
            ptype.source = value
            return
        raise ValueError("Invalid source object")
    source = field.set('default-source', __getsource, __setsource, 'Default source to load/commit data from/to')
github arizvisa / syringe / lib / ptypes / config.py View on Github external
def __getsource():
            return ptype.source
        def __setsource(value):