From a8308bd49dff5781e307309b1b9797b4fdbb6f83 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Fri, 22 Oct 2021 09:17:34 -0400 Subject: improve bible scripts --- webp.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'webp.py') diff --git a/webp.py b/webp.py index 6d88390..c79ba4a 100755 --- a/webp.py +++ b/webp.py @@ -32,7 +32,8 @@ def main(qs): print("# " + passage.format()) printing = 0 inendc = False - bookabbrev=passage.start.format('a').upper() + bookabbrev = passage.start.format('a').upper() + eprint(bookabbrev) fname = subprocess.check_output([f"find", "webp/", "-name", f'*-{bookabbrev}*']).strip() f = open(fname) startc = passage.start.chapter @@ -40,15 +41,15 @@ def main(qs): endc = passage.end.chapter endv= passage.end.verse for line in f: - if f'\\c {startc} ' in line: + if f'\\c ' in line and f' {startc} ' in line: printing = 1 if printing == 1 and (f'\\v {startv} ') in line: printing =2 - if (f'\\c {endc} ') in line: + if f'\\c ' in line and f' {endc} ' in line: inendc = True if inendc and (f'\\v {endv+1} ') in line: printing =0 - if (f'\\c {endc+1} ') in line: + if f'\\c ' in line and f' {endc+1} ' in line: printing =0 if printing>=2: -- cgit 1.4.1