WIP: Expand the developer documentation #27

Draft
gremond wants to merge 51 commits from develop into developer_docs
2 changed files with 4 additions and 5 deletions
Showing only changes of commit 560deb52b6 - Show all commits

View file

@ -480,7 +480,7 @@ class ParserVariable:
return return
family_obj = {} family_obj = {}
subfamily_obj = {} subfamily_obj = {}
force_to_attrs = list(self.list_attributes(obj)) force_to_attrs = list(self.list_attributes(obj, version))
for key, value in obj.items(): for key, value in obj.items():
if key in force_to_attrs: if key in force_to_attrs:
if key.startswith("_"): if key.startswith("_"):
@ -558,6 +558,7 @@ class ParserVariable:
def list_attributes( def list_attributes(
self, self,
obj: Dict[str, Any], obj: Dict[str, Any],
version: str,
) -> Iterator[str]: ) -> Iterator[str]:
"""List attributes""" """List attributes"""
force_to_variable = [] force_to_variable = []
@ -580,8 +581,7 @@ class ParserVariable:
): ):
# it's a dict, so a new variables! # it's a dict, so a new variables!
continue continue
# FIXME should be remove with 1.0 format if version == '1.0' and key == "variable" and obj.get("type") != "dynamic" and obj.get("_type") != "dynamic":
if key == "variable" and obj.get("type") != "dynamic":
continue continue
if key in self.family_attrs: if key in self.family_attrs:
yield key yield key

View file

@ -35,9 +35,8 @@ except ModuleNotFoundError as err:
# from ast import parse as ast_parse # from ast import parse as ast_parse
from json import dumps from json import dumps
from pathlib import Path
from ruamel.yaml import YAML from ruamel.yaml import YAML
from pathlib import Path
from .config import RougailConfig from .config import RougailConfig
from .error import UpgradeError from .error import UpgradeError