From aa72db935bfc594d1f1c731e9625290098ba3221 Mon Sep 17 00:00:00 2001 From: Eryk J Date: Wed, 8 Feb 2023 19:43:24 -0500 Subject: [PATCH] Standardise variable names --- linkture.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/linkture.py b/linkture.py index 1b87429..9c981ba 100755 --- a/linkture.py +++ b/linkture.py @@ -195,16 +195,16 @@ def reform_series(txt): # rewrite comma-separated consecutive sequences as (1, 2 return output.replace(',', ', ').strip(' ;,') def r(match): - i = match.group(1) - script, bk_name, tr_name, bk_num, rest, last = scripture_parts(i) + scripture = match.group(1) + script, bk_name, tr_name, bk_num, rest, last = scripture_parts(scripture) if bk_num: code = self._code_scripture(script, bk_num, rest, last) if code: rec = f'{script}|{bk_name}|{tr_name}|{bk_num}|{rest}|{last}' return '{{'+rec+'}}' else: - self._error_report(i, 'UNKNOWN BOOK') - return i + self._error_report(scripture, 'UNKNOWN BOOK') + return scripture self._reported = [] text = regex.sub(self._pretagged, r, text) @@ -215,9 +215,9 @@ def r(match): def list_scriptures(self, text): lst = [] text = self._locate_scriptures(text) - for i in regex.findall(self._tagged, text): - scripture, _, _, _, _, _ = i.strip('}{').split('|') - lst.append(scripture) + for scripture in regex.findall(self._tagged, text): + script, _, _, _, _, _ = scripture.strip('}{').split('|') + lst.append(script) return lst def tag_scriptures(self, text): @@ -366,9 +366,9 @@ def code_verses(chunk, book, multi): def code_scriptures(self, text): text = self._locate_scriptures(text) lst = [] - for i in regex.findall(self._tagged, text): - scripture, _, _, bk_num, rest, last = i.strip('}{').split('|') - bcv_ranges = self._code_scripture(scripture, int(bk_num), rest, int(last)) or [] + for scripture in regex.findall(self._tagged, text): + script, _, _, bk_num, rest, last = scripture.strip('}{').split('|') + bcv_ranges = self._code_scripture(script, int(bk_num), rest, int(last)) or [] for bcv_range in bcv_ranges: lst.append(bcv_range) return lst