Esempio n. 1
0
class WrappedDynamicAttributeImpl(AttributeImpl):
    """wrapper for DynamicAttributeImpl.
    
    We use a wrapper and not a subclass so that the underlying DynamicAttributeImpl 
    can refer to itself and get the "unwrapped" behavior.    
    """
    def __init__(self, *args, **kwargs):
        self.wrapped = DynamicAttributeImpl(*args, **kwargs)
        
    def get(self, state, passive=False):
        ret = self.wrapped.get(state, passive=passive)
        if isinstance(ret, Query):
            return WrappedQuery(ret)
        else:
            return ret
Esempio n. 2
0
 def __init__(self, *args, **kwargs):
     self.wrapped = DynamicAttributeImpl(*args, **kwargs)