scripts for my gemini capsule
asv: read whole chapter
Zach DeCook 2021-04-26
parent 4e63710 · commit e87db3a
-rwxr-xr-xasv.py11
m---------usfm2gmi0
2 files changed, 10 insertions, 1 deletions
diff --git a/asv.py b/asv.py
index 8014a8d..2f82304 100755
--- a/asv.py
+++ b/asv.py
@@ -17,11 +17,20 @@ def main(qs):
bookNum=passage.start.book
fname=sco(['find', 'asv/', '-name', f'{bookNum}*']).strip()
root = ET.parse(fname).getroot()
+ printing = 0
+ endc = False
for thing in list(root):
+ if thing.tag == 'chapter':
+ if int(thing.attrib['number']) == int(passage.start.chapter):
+ printing = 1
+ if int(thing.attrib['number']) == int(passage.end.chapter):
+ endc = True
+ if int(thing.attrib['number']) > int(passage.end.chapter):
+ printing = 0
+ if printing >= 1:
printf(convertBlock(thing))
- printing = 0
# for line in open("asv.xml.gmi"):
# if line == '### ' + passage.start.format().split(':')[0]:
# printing = 1
diff --git a/usfm2gmi b/usfm2gmi
-Subproject 8e9a836f62f1395ea4e49d08e27bbc89e29c857
+Subproject a3e7f46093c6ef9b72ca00249e41f542d06de6c