Esempio n. 1
0
 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
Esempio n. 2
0
 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
Esempio n. 3
0
 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)
Esempio n. 4
0
 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])
Esempio n. 5
0
 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])
Esempio n. 6
0
 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])
Esempio n. 7
0
 def _unmerged_contains(self, key):
     # type: (Any) -> Any
     if ordereddict.__contains__(self, key):
         return True
     return None
Esempio n. 8
0
 def __contains__(self, key):
     # type: (Any) -> bool
     return bool(ordereddict.__contains__(self, key))
Esempio n. 9
0
 def _unmerged_contains(self, key):
     if ordereddict.__contains__(self, key):
         return True
Esempio n. 10
0
 def _unmerged_contains(self, key):
     if ordereddict.__contains__(self, key):
         return True