Lines Matching refs:self

58     def __init__(self, search_self, search_up):
59 self._search_self = search_self
60 self._search_up = search_up
61 self._multipliers = []
63 def __str__(self):
64 if self._search_self and not self._search_up:
66 elif not self._search_self and self._search_up:
70 return s + '.' + self.path()
72 def __setattr__(self, attr, value):
76 super(BaseProxy, self).__setattr__(attr, value)
80 def __mul__(self, other):
84 self._multipliers.append(other)
85 return self
89 def _mulcheck(self, result, base):
91 for multiplier in self._multipliers:
103 def unproxy(self, base):
107 if self._search_self:
108 result, done = self.find(obj)
110 if self._search_up:
112 # as visited to avoid a self-reference
113 self._visited = True
119 result, done = self.find(obj)
121 self._visited = False
127 (self.path(), self._pdesc.ptype_str, base.path()))
130 if result == self:
134 return self._mulcheck(result, base)
152 def set_param_desc(self, pdesc):
153 self._pdesc = pdesc
156 def __init__(self, search_self, search_up, attr):
157 super(AttrProxy, self).__init__(search_self, search_up)
158 self._attr = attr
159 self._modifiers = []
161 def __getattr__(self, attr):
164 return super(AttrProxy, self).__getattr__(self, attr)
165 if hasattr(self, '_pdesc'):
167 # Return a copy of self rather than modifying self in place
168 # since self could be an indirect reference via a variable or
170 new_self = copy.deepcopy(self)
175 def __getitem__(self, key):
178 if hasattr(self, '_pdesc'):
180 new_self = copy.deepcopy(self)
184 def find(self, obj):
186 val = getattr(obj, self._attr)
204 for m in self._modifiers:
215 def path(self):
216 p = self._attr
217 for m in self._modifiers:
227 def find(self, obj):
228 return obj.find_any(self._pdesc.ptype)
230 def path(self):
236 def find(self, obj):
237 return obj.find_all(self._pdesc.ptype)
239 def path(self):
253 def __init__(self, search_self, search_up):
254 self.search_self = search_self
255 self.search_up = search_up
257 def __getattr__(self, attr):
259 return AnyProxy(self.search_self, self.search_up)
261 if self.search_up:
263 return AllProxy(self.search_self, self.search_up)
265 return AttrProxy(self.search_self, self.search_up, attr)