Пример #1
0
    def __get__(self, inst, cls=None):
        if inst is None:
            return getObjectSpecification(cls)
        else:
            provided = providedBy(getProxiedObject(inst))

            # Use type rather than __class__ because inst is a proxy and
            # will return the proxied object's class.
            cls = type(inst)
            return ObjectSpecification(provided, cls)
Пример #2
0
 def __get__(self, inst, cls=None):
     if inst is None:
         return self
     else:
         proxied_object = getProxiedObject(inst)
         checker = getattr(proxied_object, '__Security_checker__', None)
         if checker is None:
             checker = selectChecker(proxied_object)
         wrapper_checker = selectChecker(inst)
         if wrapper_checker is None:
             return checker
         elif checker is None:
             return wrapper_checker
         else:
             return CombinedChecker(wrapper_checker, checker)
Пример #3
0
 def __delete__(self, inst):
     inst = getProxiedObject(inst)
     del inst.__provides__
Пример #4
0
 def __set__(self, inst, value):
     inst = getProxiedObject(inst)
     inst.__provides__ = value