Esempio n. 1
0
 def __call__(self, class_or_builder):
     if inspect.isclass(class_or_builder):
         builders = helpers.get_api_definitions(class_or_builder)
         for name, builder in builders:
             builder.method_handler_builder.add_annotation(self)
             helpers.set_api_definition(class_or_builder, name, builder)
     else:
         class_or_builder.method_handler_builder.add_annotation(self)
     return class_or_builder
Esempio n. 2
0
    def __call__(self, class_or_builder, **kwargs):
        if self._is_consumer_class(class_or_builder):
            builders = helpers.get_api_definitions(class_or_builder)
            builders = filter(self._is_relevant_for_builder, builders)

            for name, b in builders:
                self(b, is_class=True)
                helpers.set_api_definition(class_or_builder, name, b)
        elif isinstance(class_or_builder, interfaces.RequestDefinitionBuilder):
            self._modify_request_definition(class_or_builder, kwargs)
        return class_or_builder
Esempio n. 3
0
    def __call__(self, class_or_builder):
        if self._is_consumer_class(class_or_builder):
            builders = helpers.get_api_definitions(class_or_builder)
            builders = filter(self._is_relevant_for_builder, builders)

            for name, b in builders:
                b.method_handler_builder.add_annotation(self, is_class=True)
                helpers.set_api_definition(class_or_builder, name, b)
        elif isinstance(class_or_builder, interfaces.RequestDefinitionBuilder):
            class_or_builder.method_handler_builder.add_annotation(self)
        return class_or_builder