Beispiel #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)
Beispiel #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
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