From e87db3a95944a47ab95ea530e9b710904aa03016 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Mon, 26 Apr 2021 08:17:25 -0400 Subject: asv: read whole chapter --- asv.py | 11 ++++++++++- usfm2gmi | 2 +- 2 files changed, 11 insertions(+), 2 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 index 8e9a836..a3e7f46 160000 --- a/usfm2gmi +++ b/usfm2gmi @@ -1 +1 @@ -Subproject commit 8e9a836f62f1395ea4e49d08e27bbc89e29c8579 +Subproject commit a3e7f46093c6ef9b72ca00249e41f542d06de6ce -- cgit 1.4.1