about summary refs log tree commit diff
path: root/webp.py
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2021-04-22 07:35:26 -0400
committerZach DeCook <zachdecook@librem.one>2021-04-22 07:35:26 -0400
commit9618a313d6e04b0d0d06b03f342e70a827d4f574 (patch)
tree0ff9663d9d9e85ac6380b8f0bf5776596c348349 /webp.py
parentebf3e79809ff84b9b2803aa874ad6028391a1533 (diff)
downloadcgi-bin-9618a313d6e04b0d0d06b03f342e70a827d4f574.tar.gz
web, oeb: fix small passage selection in python script
Diffstat (limited to 'webp.py')
-rwxr-xr-xwebp.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/webp.py b/webp.py
index b747d0d..49f9f2d 100755
--- a/webp.py
+++ b/webp.py
@@ -31,6 +31,7 @@ def main(qs):
   for passage in passages:
     print("# " + passage.format())
     printing = 0
+    inendc = False
     bookabbrev=passage.start.format('a').upper()
     fname = subprocess.check_output([f"find", "webp/", "-name", f'*-{bookabbrev}*']).strip()
     eprint(fname)
@@ -39,15 +40,14 @@ def main(qs):
     startv= passage.start.verse
     endc = passage.end.chapter
     endv= passage.end.verse
-    endmark = passage.end.format('a c:v')
     for line in f:
       if f'\\c {startc} ' in line:
         printing = 1
       if printing == 1 and (f'\\v {startv} ') in line:
         printing =2
       if (f'\\c {endc} ') in line:
-        printing = 3
-      if printing == 3 and (f'\\v {endv+1} ') in line:
+        inendc = True
+      if inendc and (f'\\v {endv+1} ') in line:
         printing =0
       if (f'\\c {endc+1} ') in line:
         printing =0