remove RENAME_ATTIBUTES

This commit is contained in:
Emmanuel Garette 2021-01-26 18:32:22 +01:00
parent 8eb3b99f27
commit 623d234add
2 changed files with 10 additions and 15 deletions

View File

@ -3,7 +3,6 @@
from ..i18n import _
from ..error import DictConsistencyError
from ..utils import normalize_family
from .variable import RENAME_ATTIBUTES
#mode order is important
@ -64,9 +63,8 @@ class FamilyAnnotator:
for family in families.family.values():
if not hasattr(family, 'description'):
family.description = family.name
for key, value in RENAME_ATTIBUTES.items():
setattr(family, value, getattr(family, key))
setattr(family, key, None)
family.doc = family.description
del family.description
family.name = normalize_family(family.name)
def change_modes(self):
@ -157,8 +155,9 @@ class FamilyAnnotator:
"""
for families in self.objectspace.space.variables.values():
for family in families.family.values():
if hasattr(family, 'help'):
if not hasattr(family, 'information'):
family.information = self.objectspace.information(family.xmlfiles)
family.information.help = family.help
del family.help
if not hasattr(family, 'help'):
continue
if not hasattr(family, 'information'):
family.information = self.objectspace.information(family.xmlfiles)
family.information.help = family.help
del family.help

View File

@ -39,9 +39,6 @@ FORCE_CHOICE = {'schedule': ['none', 'daily', 'weekly', 'monthly'],
}
RENAME_ATTIBUTES = {'description': 'doc'}
class VariableAnnotator: # pylint: disable=R0903
"""Annotate variable
"""
@ -99,9 +96,8 @@ class VariableAnnotator: # pylint: disable=R0903
del variable.value[idx]
if not variable.value:
del variable.value
for key, value in RENAME_ATTIBUTES.items():
setattr(variable, value, getattr(variable, key))
setattr(variable, key, None)
variable.doc = variable.description
del variable.description
if variable_type == 'follower':
if variable.multi is True:
variable.multi = 'submulti'