Esempio n. 1
0
    def __call__(self, view):
        if is_unbound_method(view) and self.attr is None:
            raise ConfigurationError(
                ('Unbound method calls are not supported, please set the '
                 'class as your `view` and the method as your `attr`'))

        if inspect.isclass(view):
            view = self.map_class(view)
        else:
            view = self.map_nonclass(view)
        return view
Esempio n. 2
0
    def __call__(self, view):
        if is_unbound_method(view) and self.attr is None:
            raise ConfigurationError(
                (
                    'Unbound method calls are not supported, please set the '
                    'class as your `view` and the method as your `attr`'
                )
            )

        if inspect.isclass(view):
            view = self.map_class(view)
        else:
            view = self.map_nonclass(view)
        return view
Esempio n. 3
0
    def _callFUT(self, val):
        from pyramid.util import is_unbound_method

        return is_unbound_method(val)