WIP: Expand the developer documentation #27

Draft
gremond wants to merge 22 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
family_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():
if key in force_to_attrs:
if key.startswith("_"):
@ -558,6 +558,7 @@ class ParserVariable:
def list_attributes(
self,
obj: Dict[str, Any],
version: str,
) -> Iterator[str]:
"""List attributes"""
force_to_variable = []
@ -580,8 +581,7 @@ class ParserVariable:
):
# it's a dict, so a new variables!
continue
# FIXME should be remove with 1.0 format
if key == "variable" and obj.get("type") != "dynamic":
if version == '1.0' and key == "variable" and obj.get("type") != "dynamic" and obj.get("_type") != "dynamic":
continue
if key in self.family_attrs:
yield key

View file

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