scripts for my gemini capsule
oeb: fix verse detection
Zach DeCook 2021-06-03
parent 8f2e3d9 · commit 80ebcc9
-rwxr-xr-xoeb.py4
-rwxr-xr-xwebp.py1
2 files changed, 1 insertions, 4 deletions
diff --git a/oeb.py b/oeb.py
index 7d8c786..fcf05d5 100755
--- a/oeb.py
+++ b/oeb.py
@@ -25,9 +25,7 @@ def main(qs):
printing = 0
inendc = False
book=passage.start.format('b').upper()
- eprint(book)
fname=sco(['find', 'oeb/', '-iname', f'*-{book}*']).strip()
- eprint(fname)
if not fname:
# TODO: throw 51?
print(f"{book} doesn't exist yet in the OEB\r\n")
@@ -41,7 +39,7 @@ def main(qs):
for line in f:
if f'\\c {startc}' == line.strip():
printing = 1
- if printing == 1 and (f'\\v {startv} ') in line:
+ if printing == 1 and (f'\\v {startv} ' in line or f'\\v {startv}' == line.strip()):
printing =2
if (f'\\c {endc}') == line.strip():
inendc = True
diff --git a/webp.py b/webp.py
index 49f9f2d..6d88390 100755
--- a/webp.py
+++ b/webp.py
@@ -34,7 +34,6 @@ def main(qs):
inendc = False
bookabbrev=passage.start.format('a').upper()
fname = subprocess.check_output([f"find", "webp/", "-name", f'*-{bookabbrev}*']).strip()
- eprint(fname)
f = open(fname)
startc = passage.start.chapter
startv= passage.start.verse