Functions | |
| def | try_open_and_parse |
| def | fail_not_found |
| def | format_type |
| def | collect_data |
| def | parse_multiple_files |
Variables | |
| tuple | INT = re.compile('[0-9]+$') |
| tuple | FLOAT = re.compile(r'[0-9]+[\.,][0-9]$') |
This module contains many utilities that are called almost everywhere during the parsing. It is more a toolbox than anything.
| def parsing.parsing_utils.collect_data | ( | key, | |
| args | |||
| ) |
Collects all items corresponding to key argument in *args. It realizes a depth-first travel of the dictionary, calling itself recursively on the structures.
| def parsing.parsing_utils.fail_not_found | ( | tag | ) |
Error when a tag is not found in a file, and should be in.
| def parsing.parsing_utils.format_type | ( | string | ) |
If the string can be converted to an int or a float, converts it.
| def parsing.parsing_utils.parse_multiple_files | ( | parsing_method, | |
| args | |||
| ) |
Parses the given file lists, and returns the dictionary containing the whole data parsed by the parsing_method function.
| def parsing.parsing_utils.try_open_and_parse | ( | xml_file | ) |
This function tries to open the file ```xml_file```, and to parse it. The program exits if one of both action fails.
1.7.6.1