-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
executable file
·69 lines (64 loc) · 1.6 KB
/
Copy pathtest.py
File metadata and controls
executable file
·69 lines (64 loc) · 1.6 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/python -tt
from ccowprogress import (codeLoc, SKRED, SKGRN, SKYEL, L3W, L2W, L1W, L4O, L3O, L2O, timeStamper)
from PIL import (Image, ImageDraw)
import glob, os
from cgi import escape
imgsize = 424, 424
def main():
if "HTTP_HOST" in os.environ:
print "Content-Type: text/html\n\n"
print "<html><body>This program is not CGI. Please run from the command line. To view this program's output, load <a href=\"progress.htm\">progress.htm</a></body></html>"
exit(0)
else:
print "Run from command line. All okay."
print timeStamper()
# print "Content-type: text/html\n\n"
"""
l = ["0000","000x","00xx","0xxx","a102","ffff"]
for i in l:
t = codeLoc(i)
print t[0]
png = Image.new("RGBA",imgsize,SKRED)
draw = ImageDraw.Draw(png)
l = ["0","5","a","f"]
c = SKYEL
t = codeLoc("fa50")
draw.point(t[0],c)
c = SKGRN
t = codeLoc("ffff")
draw.point(t[0],c)
print(">")
c = SKGRN
for i in l:
x = "000" + i
t = codeLoc(x)
draw.point(t[0],c)
c = SKYEL
for i in l:
x = "00" + i + "x"
t = codeLoc(x)
# print(t[1])
a = t[0]
b = (t[0][0] + t[1],t[0][1] + t[1])
draw.rectangle([a,b], outline = c)
c = SKGRN
for i in l:
x = "0" + i + "xx"
t = codeLoc(x)
a = t[0]
b = (t[0][0] + t[1],t[0][1] + t[1])
draw.rectangle([a,b], outline = c)
c = SKYEL
for i in l:
x = i + "xxx"
t = codeLoc(x)
a = t[0]
b = (t[0][0] + t[1],t[0][1] + t[1])
draw.rectangle([a,b], outline = c)
del draw
png.save("test.png","PNG")
# """
exit(0)
# Standard boilerplate to call the main()
if __name__ == '__main__':
main()