support optional to condition to *list

This commit is contained in:
2021-02-15 18:23:57 +01:00
parent 5821b62f39
commit 86ec629ce3
21 changed files with 94 additions and 20 deletions

View File

@ -190,6 +190,9 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
listvars,
fills,
)
elif not target.optional:
msg = f'cannot found target "{target.type}" "{target.name}"'
raise DictConsistencyError(_(msg), 2, target.xmlfiles)
remove_targets.append(target_idx)
remove_targets.sort(reverse=True)
for target_idx in remove_targets:

View File

@ -74,7 +74,7 @@ class TargetAnnotator:
raise err
# for optional variable
if not target.optional:
msg = f'cannot found target "{target.name}"'
msg = f'cannot found target "{target.type}" "{target.name}"'
raise DictConsistencyError(_(msg), 12, target.xmlfiles) from err
remove_targets.append(index)
remove_targets.sort(reverse=True)