about summary refs log tree commit diff
path: root/asv.py
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2021-04-26 08:17:25 -0400
committerZach DeCook <zachdecook@librem.one>2021-04-26 08:17:25 -0400
commite87db3a95944a47ab95ea530e9b710904aa03016 (patch)
treee68266bdac7f0e72abf86f4f09e5e1c71a966eb9 /asv.py
parent4e637101e212f361bf50d77f1faf2467897f4e29 (diff)
downloadcgi-bin-e87db3a95944a47ab95ea530e9b710904aa03016.tar.gz
asv: read whole chapter
Diffstat (limited to 'asv.py')
-rwxr-xr-xasv.py11
1 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