Exemplo n.º 1
0
    def __init__(cls, name, bases, attributes):
        super(ServiceMeta, cls).__init__(name, bases, attributes)

        if '__metaclass__' in attributes:
            return

        # Register API service
        ApiManager.register(cls)
Exemplo n.º 2
0
def Api(*args, **kwargs):
    try:
        data = ApiManager.process(Request.Method, Request.Headers, Request.Body, *args, **kwargs)

        return json.dumps(data)
    except Exception as ex:
        Log.Error("Unable to process API request (args: %r, kwargs: %r) - %s", args, kwargs, ex)
        return None
Exemplo n.º 3
0
def Api(*args, **kwargs):
    try:
        data = ApiManager.process(Request.Method, Request.Headers,
                                  Request.Body, *args, **kwargs)

        return json.dumps(data)
    except Exception, ex:
        Log.Error('Unable to process API request (args: %r, kwargs: %r) - %s',
                  args, kwargs, ex)
        return None