Total Complexity | 4 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import yaml |
||
2 | from satcfdi import Code |
||
3 | |||
4 | |||
5 | class NoAliasDumper(yaml.SafeDumper): |
||
6 | def ignore_aliases(self, data): |
||
7 | return True |
||
8 | |||
9 | |||
10 | def print_yaml(data): |
||
11 | print( |
||
12 | yaml.dump(data, Dumper=NoAliasDumper, allow_unicode=True, width=1280, sort_keys=False) |
||
13 | ) |
||
14 | |||
15 | |||
16 | def header_line(text): |
||
17 | ln = (150 - len(text)) // 2 |
||
18 | return ("=" * ln) + " " + text + " " + ("=" * ln) |
||
19 | |||
20 | |||
21 | def cfdi_header(cfdi): |
||
22 | receptor = Code(cfdi['Receptor']['Rfc'], cfdi['Receptor']['Nombre']) |
||
23 | return f"{cfdi.name} - {cfdi.uuid} {receptor}" |
||
24 |