def __contains__(self, key): if ordereddict.__contains__(self, key): return True # this will only work once the mapping/dict is built to completion for merged in getattr(self, merge_attrib, []): if key in merged[1]: return True return False
def add_yaml_merge(self, value): # type: (Any) -> None for v in value: v[1].add_referent(self) for k, v in v[1].items(): if ordereddict.__contains__(self, k): continue ordereddict.__setitem__(self, k, v) self.merge.extend(value)
def _items(self): for x in ordereddict.__iter__(self): yield x, ordereddict.__getitem__(self, x) done = [] # list of processed merge items, kept for masking for merged in getattr(self, merge_attrib, []): for x in merged[1]: if ordereddict.__contains__(self, x): continue for y in done: if x in y: break else: yield x, ordereddict.__getitem__(merged[1], x) done.append(merged[1])
def _keys(self): # type: () -> Any for x in ordereddict.__iter__(self): yield x done = [] # type: List[Any] # list of processed merge items, kept for masking for merged in getattr(self, merge_attrib, []): for x in merged[1]: if ordereddict.__contains__(self, x): continue for y in done: if x in y: break else: yield x done.append(merged[1])
def _unmerged_contains(self, key): # type: (Any) -> Any if ordereddict.__contains__(self, key): return True return None
def __contains__(self, key): # type: (Any) -> bool return bool(ordereddict.__contains__(self, key))
def _unmerged_contains(self, key): if ordereddict.__contains__(self, key): return True