2011-09-03 14:28:41 +00:00
|
|
|
from ox.text import findRe
|
|
|
|
|
|
|
|
|
|
|
|
def do():
|
|
|
|
f = open("ChronoArr_Srt.txt")
|
|
|
|
txt = f.read()
|
|
|
|
tapes = txt.split("***")
|
|
|
|
indexHtml = ''
|
|
|
|
counter = 1
|
|
|
|
for t in tapes:
|
|
|
|
fullTxt = t.strip()
|
|
|
|
titleReg = r'Title: (.*?)\n'
|
2011-09-03 14:35:29 +00:00
|
|
|
timeReg = r'Time: (.*?)\n'
|
|
|
|
time = findRe(fullTxt, time)
|
2011-09-03 14:28:41 +00:00
|
|
|
outfile = "tapes/%d.html" % (counter,)
|
|
|
|
title = findRe(fullTxt, titleReg)
|
|
|
|
print title
|
2011-09-03 14:35:29 +00:00
|
|
|
indexHtml += "<a target='_blank' href='%s'>%s</a><br />Time: %s<br/><br />\n" % (outfile, title, time,)
|
2011-09-03 14:28:41 +00:00
|
|
|
out = open(outfile, "w")
|
|
|
|
out.write("<pre>%s</pre>" % (fullTxt,))
|
|
|
|
out.close()
|
|
|
|
counter += 1
|
|
|
|
indexFile = open("index.html", "w")
|
|
|
|
indexFile.write(indexHtml)
|
|
|
|
indexFile.close()
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
|