change files to work with python3 (#7)
This commit is contained in:
parent
cf0b2bba0f
commit
ae24e5a753
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/python3
|
||||
|
||||
import sys,string,time
|
||||
sys.path.append('../internal')
|
||||
|
|
@ -8,7 +8,7 @@ months = [ '', 'January', 'February', 'March', 'April', 'May', 'June', 'July',
|
|||
'August', 'September', 'October', 'November', 'December']
|
||||
|
||||
for epnum in sys.argv[1:]:
|
||||
curep = string.atoi(epnum[:3])
|
||||
curep = int(epnum[:3])
|
||||
curepno = curep
|
||||
cureplong = '%03d' % (curep)
|
||||
prevep = '%03d' % (curep - 1)
|
||||
|
|
@ -21,7 +21,7 @@ for epnum in sys.argv[1:]:
|
|||
if epname == '':
|
||||
epname = 'XXX'
|
||||
|
||||
curep = `curep`
|
||||
curep = repr(curep)
|
||||
|
||||
input = open('story.html', 'r')
|
||||
output = open(cureplong + '.shtml', 'w')
|
||||
|
|
@ -50,12 +50,12 @@ for epnum in sys.argv[1:]:
|
|||
if line == '':
|
||||
break
|
||||
if line[:8] == '<episode':
|
||||
thisep = string.atoi(line[-5:-2])
|
||||
thisep = int(line[-5:-2])
|
||||
if thisep > max_summary:
|
||||
if not printing:
|
||||
output.write('<!--#include virtual="')
|
||||
output.write('/lurk/background/sum-' +
|
||||
`max_summary` + '" -->\n')
|
||||
repr(max_summary) + '" -->\n')
|
||||
|
||||
if thisep < curepno:
|
||||
output.write('<h1>More ' +
|
||||
|
|
@ -90,4 +90,4 @@ Last update:
|
|||
input.close()
|
||||
output.close()
|
||||
|
||||
print epnum
|
||||
print(epnum)
|
||||
|
|
|
|||
|
|
@ -9,4 +9,4 @@ while ($ep < $toteps)
|
|||
@ ep++
|
||||
end
|
||||
|
||||
gen.py $list
|
||||
./gen.py $list
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
#!/bin/csh
|
||||
gen.py [01]??
|
||||
./gen.py [01]??
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/local/bin/python
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
import sys,string
|
||||
sys.path.append('../internal')
|
||||
|
|
@ -28,7 +28,7 @@ output.write("""<html>
|
|||
|
||||
for i in range(0, 200):
|
||||
filename = "%03d" % i
|
||||
print filename
|
||||
print(filename)
|
||||
try:
|
||||
handle = open(filename, 'r')
|
||||
handle.close()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/local/bin/python
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
import sys,string
|
||||
sys.path.append('../internal')
|
||||
|
|
@ -39,4 +39,4 @@ October 8, 1995
|
|||
</html>
|
||||
"""
|
||||
|
||||
print output
|
||||
print(output)
|
||||
|
|
|
|||
19
guide/gen.py
19
guide/gen.py
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/python3
|
||||
|
||||
import sys,string,time,os
|
||||
sys.path.append('../internal')
|
||||
|
|
@ -13,7 +13,8 @@ do_jpeg = perdir.get_do_jpeg()
|
|||
args = sys.argv
|
||||
|
||||
for epnum in args[1:]:
|
||||
curep = string.atoi(epnum[:3])
|
||||
# curep = string.atoi(epnum[:3])
|
||||
curep = int(epnum[:3])
|
||||
|
||||
pix = open(perdir.get_episode_names_file(), 'r')
|
||||
for i in range(0, curep + 1):
|
||||
|
|
@ -82,7 +83,7 @@ for epnum in args[1:]:
|
|||
rewrite = open('@' + epnum, 'w')
|
||||
needsupdate = 0
|
||||
|
||||
pieces = string.splitfields(wholefile, '@@@')
|
||||
pieces = wholefile.split('@@@')
|
||||
final = pieces[0]
|
||||
rewrite.write(pieces[0])
|
||||
|
||||
|
|
@ -95,8 +96,9 @@ for epnum in args[1:]:
|
|||
if timestamp == 0:
|
||||
needsupdate = 1
|
||||
timestamp = int(time.time())
|
||||
rewrite.write('@@@' + `timestamp`)
|
||||
rewrite.write(piece[string.index(piece, ' '):])
|
||||
rewrite.write('@@@' + repr(timestamp))
|
||||
#rewrite.write(piece[string.index(piece, ' '):])
|
||||
rewrite.write(piece[piece.index(' '):])
|
||||
else:
|
||||
rewrite.write('@@@' + piece)
|
||||
|
||||
|
|
@ -105,7 +107,8 @@ for epnum in args[1:]:
|
|||
final = final + ('<strong>[[%d/%d]]</strong>' %
|
||||
(timeval[1], timeval[2]));
|
||||
|
||||
final = final + piece[string.index(piece, ' '):]
|
||||
#final = final + piece[string.index(piece, ' '):]
|
||||
final = final + piece[piece.index(' '):]
|
||||
|
||||
rewrite.close()
|
||||
if needsupdate:
|
||||
|
|
@ -139,7 +142,7 @@ for epnum in args[1:]:
|
|||
output.close()
|
||||
|
||||
if do_jpeg:
|
||||
print epnum, 'jpeg'
|
||||
print((epnum, 'jpeg'))
|
||||
else:
|
||||
print epnum
|
||||
print(epnum)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/local/bin/python
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
import sys,string,time,os
|
||||
sys.path.append('../internal')
|
||||
|
|
@ -8,7 +8,7 @@ months = [ '', 'January', 'February', 'March', 'April', 'May', 'June', 'July',
|
|||
'August', 'September', 'October', 'November', 'December']
|
||||
|
||||
for epnum in sys.argv[1:]:
|
||||
curep = string.atoi(epnum[:3])
|
||||
curep = int(epnum[:3])
|
||||
|
||||
pix = open('../internal/epnames', 'r')
|
||||
for i in range(0, curep + 1):
|
||||
|
|
@ -84,13 +84,13 @@ for epnum in sys.argv[1:]:
|
|||
rewrite = open('@' + epnum, 'w')
|
||||
needsupdate = 0
|
||||
|
||||
pieces = string.splitfields(wholefile, '@@@')
|
||||
pieces = wholefile.split('@@@')
|
||||
output.write(pieces[0])
|
||||
rewrite.write(pieces[0])
|
||||
|
||||
for piece in pieces[1:]:
|
||||
try:
|
||||
timestamp =string.atoi(piece[:string.index(piece, ' ')])
|
||||
timestamp =int(piece[:string.index(piece, ' ')])
|
||||
except:
|
||||
timestamp = 0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
#!/bin/csh
|
||||
gen.py `/bin/ls [012345]* | fgrep -v .html`
|
||||
./gen.py `/bin/ls [012345]* | fgrep -v .html`
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
#!/usr/local/bin/python
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
import sys,string
|
||||
sys.path.append('../internal')
|
||||
import otros
|
||||
|
||||
curep = string.atoi(sys.argv[1])
|
||||
curep = int(sys.argv[1])
|
||||
|
||||
if len(sys.argv) == 3:
|
||||
output = otros.pageheader(curep, 'other')
|
||||
|
|
@ -26,4 +26,4 @@ if len(sys.argv) != 3:
|
|||
<hr>
|
||||
"""
|
||||
|
||||
print output
|
||||
print(output)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/python33
|
||||
#
|
||||
# Per-directory values for /lurk/guide
|
||||
#
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ def pageheader(num, page, do_jpeg = 0):
|
|||
else:
|
||||
picname = cureplong + '/' + picname
|
||||
|
||||
curep = `curep`
|
||||
curep = repr(curep)
|
||||
picwidth = 500 - titlewidth
|
||||
|
||||
output = """
|
||||
|
|
@ -156,14 +156,14 @@ def pageheader(num, page, do_jpeg = 0):
|
|||
extension = '.gif'
|
||||
|
||||
output = output + """<img
|
||||
align=middle width=""" + `picwidth` + """ height=120 border=0
|
||||
align=middle width=""" + repr(picwidth) + """ height=120 border=0
|
||||
src="/lurk/gif/""" + picname + extension + '" alt="">'
|
||||
|
||||
if page == 'comic' or page == 'novels':
|
||||
output = output + '</a>'
|
||||
|
||||
output = output + """<img
|
||||
align=middle width=""" + `titlewidth` + """ height=120
|
||||
align=middle width=""" + repr(titlewidth) + """ height=120
|
||||
src="/lurk/gif/titles/""" + titleprefix + curep + """.gif"
|
||||
alt="">
|
||||
|
||||
|
|
@ -311,8 +311,9 @@ def mungeimages(text, do_jpeg):
|
|||
|
||||
result = ''
|
||||
|
||||
for chunk in string.splitfields(text, '.gif'):
|
||||
filepos = string.rfind(chunk, '"')
|
||||
for chunk in text.split('.gif'):
|
||||
#filepos = string.rfind(chunk, '"')
|
||||
filepos = chunk.rfind('"')
|
||||
if filepos < 0:
|
||||
result = result + chunk
|
||||
break
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
gen.py [012]??
|
||||
./gen.py [012]??
|
||||
|
|
|
|||
Loading…
Reference in New Issue