chc.util.IndexedTable module
- class chc.util.IndexedTable.IndexedTable(name: str)[source]
Bases:
chc.util.IndexedTable.IndexedTableSuperclassTable to provide unique indices to objects represented by a key string.
The table can be checkpointed and reset to that checkpoint with - set_checkpoint - reset_to_checkpoint
- Note: the string encodings use the comma as a concatenation character, hence
the comma character cannot be used in any string representation.
- add(key: Tuple[str, str], f: Callable[[int, Tuple[str, str]], chc.util.IndexedTable.IndexedTableValue]) int[source]
- add_tags_args(tags: List[str], args: List[int], f: Callable[[int, List[str], List[int]], chc.util.IndexedTable.IndexedTableValue]) int[source]
- commit_reserved(index: int, key: Tuple[str, str], obj: chc.util.IndexedTable.IndexedTableValue) None[source]
- items() List[Tuple[int, chc.util.IndexedTable.IndexedTableValue]][source]
- iter(f: Callable[[int, chc.util.IndexedTable.IndexedTableValue], None]) None[source]
- objectmap(p: Callable[[int], chc.util.IndexedTable.IndexedTableValue]) Dict[int, chc.util.IndexedTable.IndexedTableValue][source]
- read_xml(node: Optional[xml.etree.ElementTree.Element], tag: str, get_value: Callable[[xml.etree.ElementTree.Element], chc.util.IndexedTable.IndexedTableValue] = <function IndexedTable.<lambda>>, get_key: Callable[[chc.util.IndexedTable.IndexedTableValue], Tuple[str, str]] = <function IndexedTable.<lambda>>, get_index: Callable[[chc.util.IndexedTable.IndexedTableValue], int] = <function IndexedTable.<lambda>>) None[source]
- retrieve(index: int) chc.util.IndexedTable.IndexedTableValue[source]
- retrieve_by_key(f: Callable[[Tuple[str, str]], bool]) List[Tuple[Tuple[str, str], chc.util.IndexedTable.IndexedTableValue]][source]
- values() List[chc.util.IndexedTable.IndexedTableValue][source]
- write_xml(node: xml.etree.ElementTree.Element, f: Callable[[xml.etree.ElementTree.Element, chc.util.IndexedTable.IndexedTableValue], None], tag: str = 'n') None[source]
- exception chc.util.IndexedTable.IndexedTableError(msg: str, itemlist: List[Tuple[int, chc.util.IndexedTable.IndexedTableValue]] = [])[source]
Bases:
chc.util.fileutil.CHCError- property itemlist: List[Tuple[int, chc.util.IndexedTable.IndexedTableValue]]
- class chc.util.IndexedTable.IndexedTableValue(index: int, tags: List[str], args: List[int])[source]
Bases:
object- property args: List[int]
- check_key(reqtagcount: int, reqargcount: int, name: str) None[source]
Check if the constructed value has the expected tags and args.
- property index: int
- property key: Tuple[str, str]
- property tags: List[str]
- exception chc.util.IndexedTable.IndexedTableValueMismatchError(tag: str, reqtagcount: int, reqargcount: int, acttagcount: int, actargcount: int, name: str)[source]
Bases:
chc.util.fileutil.CHCError
- chc.util.IndexedTable.get_attribute_int_list(node: xml.etree.ElementTree.Element, attr: str) List[int][source]
Return list of integers in attr if attr is present or [] otherwise.
- chc.util.IndexedTable.get_rep(node: xml.etree.ElementTree.Element) Tuple[int, List[str], List[int]][source]
- chc.util.IndexedTable.get_value(node: xml.etree.ElementTree.Element) chc.util.IndexedTable.IndexedTableValue[source]