Passed
Push — master ( 42467a...9d011f )
by Matěj
03:19 queued 11s
created

generate_contributors   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
eloc 17
dl 0
loc 26
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A utils.generate_contributors.main() 0 13 3
1
#!/usr/bin/env python2
2
3
import os.path
4
import codecs
5
import ssg
6
import ssg.contributors
7
8
9
def main():
10
    contributors_md, contributors_xml = ssg.contributors.generate()
11
12
    root_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
13
    with codecs.open(os.path.join(root_dir, "Contributors.md"),
14
                     mode="w", encoding="utf-8") as f:
15
        f.write(contributors_md)
16
17
    with codecs.open(os.path.join(root_dir, "Contributors.xml"),
18
                     mode="w", encoding="utf-8") as f:
19
        f.write(contributors_xml)
20
21
    print("Don't forget to commit Contributors.md and Contributors.xml!")
22
23
24
if __name__ == "__main__":
25
    main()
26