Skip to content

Commit

Permalink
minor bug fix for skippable objects
Browse files Browse the repository at this point in the history
  • Loading branch information
mtholder committed May 27, 2024
1 parent bb63e8d commit 2a506ef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/semanticize_amendments.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
_SCRIPT_NAME = 'semanticize_amendments'

def warn(msg):
sys.stderr.write('{} WARNING: {}\n'.format(SCRIPT_NAME, msg))
sys.stderr.write(f'{_SCRIPT_NAME} WARNING: {msg}\n')

def processs_addition(amend_id, taxon):
ott_id = taxon["ott_id"]
Expand All @@ -37,7 +37,7 @@ def processs_addition(amend_id, taxon):

def processs_amendment(fp, content):
if not content:
return
return
try:
blob = json.loads(content)
except:
Expand All @@ -61,7 +61,8 @@ def main(repo_top, last_handled_sha):
sys.stderr.write(f"processing {fp} ...\n")
content = repo.get_file_contents(oid)
tb = processs_amendment(fp, content)
all_terse_blobs.extend(tb)
if tb is not None:
all_terse_blobs.extend(tb)
else:
sys.stderr.write(f"skipping {fp} ...\n")
print(json.dumps(all_terse_blobs, indent=2))
Expand Down

0 comments on commit 2a506ef

Please sign in to comment.