tartans working with py3

This commit is contained in:
Neale Pickett 2013-12-08 22:25:49 +00:00
parent 0ec6ce9da4
commit c7c4d333dc
3 changed files with 15 additions and 14 deletions

View File

@ -4,6 +4,7 @@
#define GIT_PROJECT_ROOT "/home/neale/projects"
#define CGIT_CONFIG "/home/neale/public_html/cgitrc"
#define CGIT "/usr/lib/cgit/cgit.cgi"
int
main(int argc, char *argv[])
@ -16,7 +17,7 @@ main(int argc, char *argv[])
execlp("git", "git", "http-backend", NULL);
} else {
setenv("CGIT_CONFIG", CGIT_CONFIG, 1);
execl("/usr/local/bin/cgit", "cgit", NULL);
execl(CGIT, "cgit", NULL);
}
return 0;

View File

@ -3,11 +3,11 @@
import cgitb; cgitb.enable()
import loom
import cgi
import urllib
import urllib.request, urllib.parse, urllib.error
import os
import sys
os.chdir(os.path.dirname(sys.argv[0]))
os.chdir("/home/neale/public_html/tartans")
f = cgi.FieldStorage()
@ -33,7 +33,7 @@ else:
print('')
sys.stdout.flush()
content = ('Name: %s\nSett: %s\n' % (t, s))
png = 'design.cgi?sett=%s' % urllib.quote(s_)
png = 'design.cgi?sett=%s' % urllib.parse.quote(s_)
cvt = os.popen('./tartantomdwn %s tartan.m4 | ../mdwntohtml ../template.m4' % (png,),
'w')
cvt.write(content)

View File

@ -92,40 +92,40 @@ class PNGLoom(Loom):
def ascii_test():
print 'Plain weave'
print('Plain weave')
l = Loom('||||||||||||||||||||||||||||||||')
for i in range(16):
l.plain_weave('-')
for row in l.fabric:
print ' ', ''.join(row)
print(' ', ''.join(row))
print 'Twill'
print('Twill')
l = Loom('||||||||||||||||||||||||||||||||')
for i in range(16):
l.twill('-')
for row in l.fabric:
print ' ', ''.join(row)
print(' ', ''.join(row))
print '2/1 twill'
print('2/1 twill')
l = Loom('||||||||||||||||||||||||||||||||')
for i in range(16):
l.twill('-', 2, 1)
for row in l.fabric:
print ' ', ''.join(row)
print(' ', ''.join(row))
print 'Satin weave'
print('Satin weave')
l = Loom('||||||||||||||||||||||||||||||||')
for i in range(16):
l.satin_weave('-')
for row in l.fabric:
print ' ', ''.join(row)
print(' ', ''.join(row))
print 'Basketweave'
print('Basketweave')
l = Loom('||||||||||||||||||||||||||||||||')
for i in range(16):
l.basket_weave('-')
for row in l.fabric:
print ' ', ''.join(row)
print(' ', ''.join(row))
##