Exemplo n.º 1
0
 def _values(self):
     # type: () -> Any
     for x in ordereddict.__iter__(self):
         yield 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 in merged[1]:
             if ordereddict.__contains__(self, x):
                 continue
             for y in done:
                 if x in y:
                     break
             else:
                 yield ordereddict.__getitem__(merged[1], x)
         done.append(merged[1])
Exemplo n.º 2
0
 def _values(self):
     # type: () -> Any
     for x in ordereddict.__iter__(self):
         yield 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 in merged[1]:
             if ordereddict.__contains__(self, x):
                 continue
             for y in done:
                 if x in y:
                     break
             else:
                 yield ordereddict.__getitem__(merged[1], x)
         done.append(merged[1])
Exemplo n.º 3
0
 def __getitem__(self, key):
     try:
         return ordereddict.__getitem__(self, key)
     except KeyError:
         for merged in getattr(self, merge_attrib, []):
             if key in merged[1]:
                 return merged[1][key]
         raise
Exemplo n.º 4
0
 def __getitem__(self, key):
     # type: (Any) -> Any
     try:
         return ordereddict.__getitem__(self, key)
     except KeyError:
         for merged in getattr(self, merge_attrib, []):
             if key in merged[1]:
                 return merged[1][key]
         raise
Exemplo n.º 5
0
 def non_merged_items(self):
     # type: () -> Any
     for x in ordereddict.__iter__(self):
         yield x, ordereddict.__getitem__(self, x)
Exemplo n.º 6
0
 def _items(self):
     # type: () -> Any
     for x in ordereddict.__iter__(self):
         yield x, ordereddict.__getitem__(self, x)
Exemplo n.º 7
0
 def non_merged_items(self):
     # type: () -> Any
     for x in ordereddict.__iter__(self):
         if x in self._ok:
             yield x, ordereddict.__getitem__(self, x)