Beispiel #1
0
 def registering_decorator(fn, args, kwargs):
     instance = cls(*args, **kwargs)
     register_entrypoint(fn, instance)
     if instance.method in ('GET', 'POST', 'DELETE', 'PUT') and \
             ('*' in instance.allowed_methods or instance.method in instance.allowed_methods):
         options_args = ['OPTIONS'] + list(args[1:])
         options_instance = cls(*options_args, **kwargs)
         register_entrypoint(fn, options_instance)
     return fn
Beispiel #2
0
 def registering_decorator(fn, args, kwargs):
     instance = cls(*args, **kwargs)
     register_entrypoint(fn, instance)
     if instance.method in ("GET", "POST", "DELETE", "PUT", "HEAD") and (
         "*" in instance.allowed_methods
         or instance.method in instance.allowed_methods
     ):
         options_args = ["OPTIONS"] + list(args[1:])
         options_instance = cls(*options_args, **kwargs)
         register_entrypoint(fn, options_instance)
     return fn
Beispiel #3
0
        def register_miso_entrypoint(fn, args, kwargs, cls):
            if not hasattr(fn, '_miso_options'):
                fn._miso_options = MisoOverrideOptions()
                fn._master_only = fn._miso_options.master_only

            for prop in [
                    p for p in dir(MisoOverrideOptions)
                    if not p.startswith('_')
            ]:
                if prop in kwargs:
                    setattr(fn._miso_options, prop, kwargs[prop])
                    del kwargs[prop]

            instance = cls(*args, **kwargs)
            register_entrypoint(fn, instance)
            return fn
Beispiel #4
0
 def registering_decorator(fn, a, kw):
     instance = cls(*a, **kw)
     register_entrypoint(fn, instance)
     return fn
Beispiel #5
0
 def registering_decorator(fn, args, kwargs):
     instance = cls(stub, *args, **kwargs)
     register_entrypoint(fn, instance)
     return fn