about summary refs log tree commit diff
path: root/webp.py
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2021-10-30 11:58:28 -0400
committerZach DeCook <zachdecook@librem.one>2021-10-30 11:58:51 -0400
commitb3752923aa7f80fc49fbda5c82b879016ff2d026 (patch)
tree0cfcd2682f305e6914928e777c03c34636bdc0fe /webp.py
parent5efd5834df9682afa3644b8246fa83dc64cf4822 (diff)
downloadcgi-bin-b3752923aa7f80fc49fbda5c82b879016ff2d026.tar.gz
bibles: fix the web
Diffstat (limited to 'webp.py')
-rwxr-xr-xwebp.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/webp.py b/webp.py
index c79ba4a..7532b13 100755
--- a/webp.py
+++ b/webp.py
@@ -19,7 +19,8 @@ def main(qs):
   if not qs:
     print("10 Enter a scripture reference\r\n")
     return
-
+  books=subprocess.check_output([f"find", "webp/", "-name", f'??-*.usfm']).strip().split(b"\n")
+  books.sort()
   passages = parse_string(qs)
   # TODO: Also handle "john 3, tomato 2" errors?
   if type(passages[0]) == tuple:
@@ -32,10 +33,9 @@ def main(qs):
     print("# " + passage.format())
     printing = 0
     inendc = False
-    bookabbrev = passage.start.format('a').upper()
-    eprint(bookabbrev)
-    fname = subprocess.check_output([f"find", "webp/", "-name", f'*-{bookabbrev}*']).strip()
-    f = open(fname)
+    bookn = passage.start.book
+    eprint(bookn)
+    f = open(books[bookn])
     startc = passage.start.chapter
     startv= passage.start.verse
     endc = passage.end.chapter