Add index assignment message as stopgap

This commit is contained in:
Tim Van Baak 2020-05-01 00:08:13 -07:00
parent 6d7e7a8a42
commit 3386733d77
1 changed files with 5 additions and 2 deletions

View File

@ -77,6 +77,11 @@ def title_constraint_analysis(
warnings: list = [] warnings: list = []
errors: list = [] errors: list = []
with lexicon.ctx.read('info') as info: with lexicon.ctx.read('info') as info:
turn = lexicon.cfg.turn.current
assignments = lexicon.cfg.turn.assignment.get(str(turn), [])
for char_id, index_pattern in assignments:
if char_id == cid:
infos.append(f'Assigned index: {index_pattern}')
# E: No title # E: No title
if not title: if not title:
errors.append('Missing title') errors.append('Missing title')
@ -101,8 +106,6 @@ def title_constraint_analysis(
index = get_index_for_title(lexicon, title) index = get_index_for_title(lexicon, title)
infos.append(f'Article index: {index}') infos.append(f'Article index: {index}')
# E: The article does not sort under the player's assigned index # E: The article does not sort under the player's assigned index
turn = lexicon.cfg.turn.current
assignments = lexicon.cfg.turn.assignment.get(turn, [])
fits = None fits = None
for char_id, index_pattern in assignments: for char_id, index_pattern in assignments:
if char_id == cid and fits is None: if char_id == cid and fits is None: