From 9791c5899d4c1a863621fe201cd4416ccc1feadf Mon Sep 17 00:00:00 2001 From: Steven Grimm Date: Sun, 26 May 2019 19:33:05 +0000 Subject: [PATCH] Don't require space at end of timestamp line in gen.py --- Makefile | 8 ++++---- guide/gen.py | 4 ++-- guide/gen.py.nojpg | 5 ++++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index b07682ca..4077ed55 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,10 @@ lurker-nobg.html: lurker.html sed -e 's/ BGSTART.*BGEND//' -e '/BGLINK/d' < lurker.html > $@ subdirs: - @(cd guide; make) - @(cd comic; make) - @(cd synops; make) - @(cd novels; make) + @(cd guide; sh genall.csh) + @(cd comic; sh genall.csh) + @(cd synops; sh genall.csh) + @(cd novels; sh genall.csh) tvlist: $(B5DIR)/b5tvlist.txt diff --git a/guide/gen.py b/guide/gen.py index b6b2ba1c..c9406401 100755 --- a/guide/gen.py +++ b/guide/gen.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 -import sys,string,time,os +import sys,string,time,os,re sys.path.append('../internal') import otros sys.path.insert(0, '.') @@ -89,7 +89,7 @@ for epnum in args[1:]: for piece in pieces[1:]: try: - timestamp =string.atoi(piece[:string.index(piece, ' ')]) + timestamp = int(re.split('\\s', piece)[0]) except: timestamp = 0 diff --git a/guide/gen.py.nojpg b/guide/gen.py.nojpg index 30631778..feffebb9 100644 --- a/guide/gen.py.nojpg +++ b/guide/gen.py.nojpg @@ -90,7 +90,10 @@ for epnum in sys.argv[1:]: for piece in pieces[1:]: try: - timestamp =int(piece[:string.index(piece, ' ')]) + if ' ' in piece: + timestamp = int(piece[:string.index(piece, ' ')]) + else: + timestamp = int(piece) except: timestamp = 0