diff --git a/background/gen.py b/background/gen.py index adde8f8c..2adbb285 100755 --- a/background/gen.py +++ b/background/gen.py @@ -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] == ' max_summary: if not printing: output.write('\n') + repr(max_summary) + '" -->\n') if thisep < curepno: output.write('

More ' + @@ -90,4 +90,4 @@ Last update: input.close() output.close() - print epnum + print(epnum) diff --git a/background/genall.csh b/background/genall.csh index 7e9435aa..e3fd6028 100644 --- a/background/genall.csh +++ b/background/genall.csh @@ -9,4 +9,4 @@ while ($ep < $toteps) @ ep++ end -gen.py $list +./gen.py $list diff --git a/credits/genall.csh b/credits/genall.csh index 89479bc5..b2a3315d 100644 --- a/credits/genall.csh +++ b/credits/genall.csh @@ -1,2 +1,2 @@ #!/bin/csh -gen.py [01]?? +./gen.py [01]?? diff --git a/credits/genindex.py b/credits/genindex.py index e3048e61..0aecacbd 100644 --- a/credits/genindex.py +++ b/credits/genindex.py @@ -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(""" for i in range(0, 200): filename = "%03d" % i - print filename + print(filename) try: handle = open(filename, 'r') handle.close() diff --git a/guide/footer.py b/guide/footer.py index 16e25f2b..807f234d 100644 --- a/guide/footer.py +++ b/guide/footer.py @@ -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 """ -print output +print(output) diff --git a/guide/gen.py b/guide/gen.py index 453eec7d..b6b2ba1c 100755 --- a/guide/gen.py +++ b/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 + ('[[%d/%d]]' % (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) diff --git a/guide/gen.py.nojpg b/guide/gen.py.nojpg index 107c7c1e..30631778 100644 --- a/guide/gen.py.nojpg +++ b/guide/gen.py.nojpg @@ -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 diff --git a/guide/genall.csh b/guide/genall.csh index 7db272cf..ca62a2f0 100644 --- a/guide/genall.csh +++ b/guide/genall.csh @@ -1,2 +1,2 @@ #!/bin/csh -gen.py `/bin/ls [012345]* | fgrep -v .html` +./gen.py `/bin/ls [012345]* | fgrep -v .html` diff --git a/guide/header.py b/guide/header.py index b16b43f2..fb1b4eb7 100644 --- a/guide/header.py +++ b/guide/header.py @@ -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:
""" -print output +print(output) diff --git a/guide/perdir.py b/guide/perdir.py index 80b9c123..f9b869f3 100755 --- a/guide/perdir.py +++ b/guide/perdir.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python33 # # Per-directory values for /lurk/guide # diff --git a/internal/otros.py b/internal/otros.py index 93c93e0f..568792eb 100644 --- a/internal/otros.py +++ b/internal/otros.py @@ -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 + """' if page == 'comic' or page == 'novels': output = output + '' output = output + """ @@ -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 diff --git a/synops/genall.csh b/synops/genall.csh index 99d2d137..a9933eae 100644 --- a/synops/genall.csh +++ b/synops/genall.csh @@ -1 +1 @@ -gen.py [012]?? +./gen.py [012]??