WIP: Expand the developer documentation #27

Draft
gremond wants to merge 51 commits from develop into developer_docs
Showing only changes of commit ee9d0b388a - Show all commits

View file

@ -30,6 +30,7 @@ class Annotator(Walk):
def __init__(self, objectspace, *args) -> None:
if not objectspace.paths:
return
self.alternative_names = {}
self.objectspace = objectspace
not_for_commandlines = []
for family in self.get_families():
@ -59,6 +60,17 @@ class Annotator(Walk):
return
alternative_name = variable.alternative_name
variable_path = variable.path
all_letters = ''
for letter in alternative_name:
all_letters += letter
if all_letters == 'h':
msg = _(f'alternative_name "{alternative_name}" conflict with "--help"')
raise DictConsistencyError(msg, 202, variable.xmlfiles)
if all_letters in self.alternative_names:
msg = _(f'conflict alternative_name "{alternative_name}": "{variable_path}" and "{self.alternative_names[all_letters]}"')
raise DictConsistencyError(msg, 202, variable.xmlfiles)
self.alternative_names[alternative_name] = variable_path
if '.' not in variable_path:
path = alternative_name
else:
@ -71,7 +83,7 @@ class Annotator(Walk):
raise DictConsistencyError(_(f'negative_description is mandatory for boolean variable, but "{variable.path}" hasn\'t'), 200, variable.xmlfiles)
return
if variable.type != 'boolean':
raise DictConsistencyError(_(f'negative_description is only available for boolean variable, but "{variable.path}" is "{variable.type}"'), 200, variable.xmlfiles)
raise DictConsistencyError(_(f'negative_description is only available for boolean variable, but "{variable.path}" is "{variable.type}"'), 201, variable.xmlfiles)
self.objectspace.informations.add(
variable.path, "negative_description", variable.negative_description
)