satdigitalinvoice.log_tools   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 13
dl 0
loc 22
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A NoAliasDumper.ignore_aliases() 0 2 1

3 Functions

Rating   Name   Duplication   Size   Complexity  
A print_yaml() 0 3 1
A header_line() 0 3 1
A to_yaml() 0 2 1
1
import yaml
2
3
4
class NoAliasDumper(yaml.SafeDumper):
5
    def ignore_aliases(self, data):
6
        return True
7
8
9
def print_yaml(data):
10
    print(
11
        to_yaml(data)
12
    )
13
14
15
def to_yaml(data):
16
    return yaml.dump(data, Dumper=NoAliasDumper, allow_unicode=True, width=1280, sort_keys=False)
17
18
19
def header_line(text):
20
    ln = (150 - len(text)) // 2
21
    return ("=" * ln) + " " + text + " " + ("=" * ln) + "\n"
22