From f2e3803874b306eafbda39b94e5c34462e55c074 Mon Sep 17 00:00:00 2001 From: Taka Date: Thu, 7 Feb 2019 12:44:20 +0000 Subject: [PATCH] Log a warning if the multi-applicable notes are using ½ (instead of ½). --- vasl_templates/webapp/vo_notes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vasl_templates/webapp/vo_notes.py b/vasl_templates/webapp/vo_notes.py index 75810d8..2954f0f 100644 --- a/vasl_templates/webapp/vo_notes.py +++ b/vasl_templates/webapp/vo_notes.py @@ -122,12 +122,16 @@ def _do_get_vo_notes( vo_type ): #pylint: disable=too-many-statements,too-many-l key = get_ma_note_key( nat2, fname ) if extn_id: key = "{}:{}".format( extn_id, key ) - with open( os.path.join(root,fname), "r" ) as fp: + fname = os.path.join( root, fname ) + with open( fname, "r" ) as fp: buf = fp.read().strip() if not buf: continue # nb: ignore placeholder files if buf.startswith( "

" ): buf = buf[3:].strip() + if "½" in buf: + # NOTE: VASSAL doesn't like this, use "frac12;" :-/ + logging.warning( "Found ½ in HTML: %s", fname ) ma_notes[key] = buf if "multi-applicable" in vo_notes[ vo_type2 ][ nat2 ]: vo_notes[ vo_type2 ][ nat2 ][ "multi-applicable" ].update( ma_notes )