Exemple #1
0
    def index_attributes(self, aa: CAttributes) -> int:
        args = [self.index_attribute(a) for a in aa.get_attributes()]

        def f(index: int, key: Tuple[str, str]) -> CAttributes:
            return CAttributes(self, index, aa.tags, args)

        return self.attributes_table.add(IT.get_key(aa.tags, aa.args), f)
Exemple #2
0
 def get_value(node: ET.Element) -> CAttributes:
     rep = IT.get_rep(node)
     args = (self,) + rep
     return CAttributes(*args)
Exemple #3
0
 def ia(attrs: CAttributes) -> List[int]:
     return [] if len(attrs.get_attributes()) == 0 else [self.index_attributes(attrs)]
Exemple #4
0
 def f(index: int, key: Tuple[str, str]) -> CAttributes:
     return CAttributes(self, index, aa.tags, args)