-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsvg.py
40 lines (29 loc) · 1.01 KB
/
svg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import re
from svg_config import Config
def matraz_svg(license=None, contact=False, documentation=False, doi=None):
blocks = re.split(r'<!-- .* -->', Config)
image = blocks[0]
current_box = 1
if license:
image += blocks[current_box]
image += 'LICENSE (' + license + ')'
image += blocks[current_box+1] + blocks[current_box+2]
current_box = current_box + 3
if contact:
image += blocks[current_box]
image += "CONTACT INFO"
image += blocks[current_box+1] + blocks[current_box+2]
current_box = current_box + 3
if documentation:
image += blocks[current_box]
image += "DOCUMENTATION"
image += blocks[current_box+1] + blocks[current_box+2]
current_box = current_box + 3
if doi:
image += blocks[current_box]
image += "DOI"
image += blocks[current_box+1] + blocks[current_box+2]
current_box = current_box + 3
image += blocks[-2]
image += blocks[-1]
return image