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 __contains__(self, key): # type: (Any) -> bool 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 _items(self): # type: () -> Any for x in ordereddict.__iter__(self): yield x, ordereddict.__getitem__(self, x) done = [] # type: List[Any] # list of processed merge items, kept for masking for merged in getattr(self, merge_attrib, []): for x, v in merged[1].items(): if ordereddict.__contains__(self, x): continue for y in done: if x in y: break else: yield x, v # ordereddict.__getitem__(merged[1], x) done.append(merged[1])
def _items(self): # type: () -> Any for x in ordereddict.__iter__(self): yield x, ordereddict.__getitem__(self, x) done = [ ] # type: List[Any] # list of processed merge items, kept for masking for merged in getattr(self, merge_attrib, []): for x, v in merged[1].items(): if ordereddict.__contains__(self, x): continue for y in done: if x in y: break else: yield x, v # ordereddict.__getitem__(merged[1], 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))