-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConsentCanvas.py
33 lines (27 loc) · 995 Bytes
/
ConsentCanvas.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
import sys
from analyze.analyze import analyze
from render.render import render
def PrintUsage():
print "Usage: ConsentCanvas.py <eula1>"
def texturize(txt):
analyzeDictionary = analyze(txt)
output = render(txt
,contacts = analyzeDictionary["contacts"]
,vlpfs = analyzeDictionary["vlpfs"]
,headerSpan = analyzeDictionary["headers"]
#,highVlpfs = analyzeDictionary["highVlpfs"]
#,leadTile = ...
,newlines = analyzeDictionary["newlines"]
,tiles = analyzeDictionary["segments"]
)
return output
if __name__ == "__main__":
if len(sys.argv) != 2:
PrintUsage()
else:
filename = sys.argv[1]
file = open(filename)
txt = file.read()
print texturize(txt)
texturedEula = open((filename + '-canvas.html'),'w')
texturedEula.write(str(texturize(txt)))