dddp/api.py
def api_endpoints(obj):
    """Iterator over all API endpoint names and callbacks."""
    for name in dir(obj):
        attr = getattr(obj, name)
        api_path = getattr(attr, 'api_path', None)
        if api_path:
            yield (
                '%s%s' % (obj.api_path_prefix, api_path),
                attr,
            )
    for api_provider in obj.api_providers:
        for api_path, attr in api_endpoints(api_provider):
            yield (api_path, attr)
def api_endpoints(obj):
    for name in dir(obj):
        attr = getattr(obj, name)
        api_path = getattr(attr, 'api_path', None)
        if api_path:
            yield (
                '%s%s' % (obj.api_path_prefix, api_path),
                attr,
            )
    for api_provider in obj.api_providers:
        for api_path, attr in api_endpoints(api_provider):
            yield (api_path, attr)
def api_endpoints ( obj ) : for name in dir ( obj ) : attr = getattr ( obj , name ) api_path = getattr ( attr , 'api_path' , None ) if api_path : yield ( '%s%s' % ( obj . api_path_prefix , api_path ) , attr , ) for api_provider in obj . api_providers : for api_path , attr in api_endpoints ( api_provider ) : yield ( api_path , attr )
Iterator over all API endpoint names and callbacks.
Iterator over all API endpoint names and callbacks .