diff --git a/src/rougail/annotator/__init__.py b/src/rougail/annotator/__init__.py index 91ede8a38..ef02d3fd5 100644 --- a/src/rougail/annotator/__init__.py +++ b/src/rougail/annotator/__init__.py @@ -1,7 +1,7 @@ """Annotate dictionaries """ from .group import GroupAnnotator -from .service import ServiceAnnotator, ERASED_ATTRIBUTES +from .service import ServiceAnnotator from .variable import VariableAnnotator, CONVERT_OPTION from .check import CheckAnnotator from .value import ValueAnnotator @@ -30,4 +30,4 @@ class SpaceAnnotator: # pylint: disable=R0903 ValueAnnotator(objectspace) -__all__ = ('SpaceAnnotator', 'ERASED_ATTRIBUTES', 'CONVERT_OPTION', 'modes') +__all__ = ('SpaceAnnotator', 'CONVERT_OPTION', 'modes') diff --git a/src/rougail/annotator/family.py b/src/rougail/annotator/family.py index 0bde0cbd4..d9e450094 100644 --- a/src/rougail/annotator/family.py +++ b/src/rougail/annotator/family.py @@ -46,6 +46,8 @@ class FamilyAnnotator: self.convert_help() def family_names(self) -> None: + """Set doc, path, ... to family + """ for families in self.objectspace.space.variables.values(): families.doc = families.name families.path = families.name diff --git a/src/rougail/annotator/value.py b/src/rougail/annotator/value.py index 761ec55a5..06b414a36 100644 --- a/src/rougail/annotator/value.py +++ b/src/rougail/annotator/value.py @@ -1,5 +1,8 @@ -class ValueAnnotator: - """Annotate check +"""Annotate value +""" + +class ValueAnnotator: # pylint: disable=R0903 + """Annotate value """ def __init__(self, objectspace, @@ -10,6 +13,8 @@ class ValueAnnotator: self.convert_value() def convert_value(self) -> None: + """convert value + """ for families in self.objectspace.space.variables.values(): for family in families.family.values(): for variable in family.variable.values(): @@ -23,8 +28,8 @@ class ValueAnnotator: else: self._convert_value(variable) - def _convert_value(self, - variable, + @staticmethod + def _convert_value(variable, variable_type: str=None, ) -> None: if not hasattr(variable, 'value'): diff --git a/src/rougail/tiramisureflector.py b/src/rougail/tiramisureflector.py index 11981b532..22b4a11c1 100644 --- a/src/rougail/tiramisureflector.py +++ b/src/rougail/tiramisureflector.py @@ -2,12 +2,14 @@ flattened XML specific """ from .config import Config -from .annotator import ERASED_ATTRIBUTES, CONVERT_OPTION +from .annotator import CONVERT_OPTION from .objspace import RootRougailObject FUNC_TO_DICT = [] -ATTRIBUTES_ORDER = ('name', 'doc', 'default', 'values', 'multi', 'default_multi', 'properties', 'validators', 'min_number', 'max_number') +ATTRIBUTES_ORDER = ('name', 'doc', 'default', 'values', 'multi', 'default_multi', 'properties', + 'validators', 'min_number', 'max_number', + ) class Root(): # pylint: disable=R0903 @@ -159,7 +161,8 @@ class Common: self.text = text self.elt.reflector_object = self - def populate_properties(self, child): + @staticmethod + def populate_properties(child) -> str: """Populate properties """ assert child.type == 'calculation' @@ -193,7 +196,8 @@ class Common: if key == 'properties': value = self.properties_to_string() elif key == 'validators': - value = '[' + ', '.join([self.calculation_value(val, ['ParamSelfOption()']) for val in value]) + ']' + value = '[' + ', '.join([self.calculation_value(val, ['ParamSelfOption()']) \ + for val in value]) + ']' elif key == 'values': if value[0].type == 'calculation': value = value[0].name.reflector_object.get()