예제 #1
0
 def __getattr__(self, name):
     # allow directive extension names to work
     directives = getattr(self.registry, '_directives', {})
     c = directives.get(name)
     if c is None:
         raise AttributeError(name)
     c, action_wrap = c
     if action_wrap:
         c = action_method(c)
     m = types.MethodType(c, self, self.__class__)
     return m
예제 #2
0
 def __getattr__(self, name):
     # allow directive extension names to work
     directives = getattr(self.registry, '_directives', {})
     c = directives.get(name)
     if c is None:
         raise AttributeError(name)
     c, action_wrap = c
     if action_wrap:
         c = action_method(c)
     m = types.MethodType(c, self, self.__class__)
     return m
예제 #3
0
파일: __init__.py 프로젝트: ppaez/pyramid
 def __getattr__(self, name):
     # allow directive extension names to work
     directives = getattr(self.registry, '_directives', {})
     c = directives.get(name)
     if c is None:
         raise AttributeError(name)
     c, action_wrap = c
     if action_wrap:
         c = action_method(c)
     # Create a bound method (works on both Py2 and Py3)
     # http://stackoverflow.com/a/1015405/209039
     m = c.__get__(self, self.__class__)
     return m
예제 #4
0
파일: __init__.py 프로젝트: brianr/pyramid
 def __getattr__(self, name):
     # allow directive extension names to work
     directives = getattr(self.registry, '_directives', {})
     c = directives.get(name)
     if c is None:
         raise AttributeError(name)
     c, action_wrap = c
     if action_wrap:
         c = action_method(c)
     # Create a bound method (works on both Py2 and Py3)
     # http://stackoverflow.com/a/1015405/209039
     m = c.__get__(self, self.__class__)
     return m