diff options
| author | Zach DeCook <zachdecook@librem.one> | 2021-10-22 09:17:34 -0400 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2021-10-22 09:17:34 -0400 |
| commit | a8308bd49dff5781e307309b1b9797b4fdbb6f83 (patch) | |
| tree | 9bd95e295d05015d879a09058f29d66df5139848 | |
| parent | 3fd01042c537554dee6f540052df3e84ed4c8790 (diff) | |
| download | cgi-bin-a8308bd49dff5781e307309b1b9797b4fdbb6f83.tar.gz | |
improve bible scripts
| -rwxr-xr-x | oeb.py | 2 | ||||
| -rwxr-xr-x | oebindex.awk | 2 | ||||
| -rwxr-xr-x | webp.py | 9 |
3 files changed, 8 insertions, 5 deletions
diff --git a/oeb.py b/oeb.py index fcf05d5..7e97b26 100755 --- a/oeb.py +++ b/oeb.py @@ -39,6 +39,8 @@ def main(qs): for line in f: if f'\\c {startc}' == line.strip(): printing = 1 + if startv <= 1: + printing = 2 if printing == 1 and (f'\\v {startv} ' in line or f'\\v {startv}' == line.strip()): printing =2 if (f'\\c {endc}') == line.strip(): diff --git a/oebindex.awk b/oebindex.awk index a3a1884..007d178 100755 --- a/oebindex.awk +++ b/oebindex.awk @@ -1,6 +1,6 @@ ($1 == "\\h"){ print "=> oeb.py?" startref"-"chapter"%3A"verse section; - book = substr($0, 4); print "# " book; gsub(/ /, "%20", book); + book = substr($0, 4); print "## " book; gsub(/ /, "%20", book); verse = 1; chapter = 1; section = ""; startref = book"%20"chapter"%3A"verse } 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: |
