Fix: _effective_config_file(): get root node to have the YAML tag
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 4 Sep 2020 01:03:02 +0000 (21:03 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 4 Sep 2020 01:03:02 +0000 (21:03 -0400)
The `config_node` property of a `config_parse_v3._Parser` object returns
an ordered dict; what we want for _yaml_dump() to write the barectf 3
YAML tag is a `_ConfigNodeV3` which is (now) the
`config_parse_common.root_node` property.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
barectf/config_parse.py
barectf/config_parse_common.py

index 1f7efdaf11404859e03d4a1454a8f585b2d46a9d..7ebe2256115df60aa7ddbaf1f7281924f035993f 100644 (file)
@@ -77,7 +77,7 @@ def _effective_config_file(file: TextIO, with_pkg_include_dir: bool,
                            include_dirs: Optional[List[str]], ignore_include_not_found: bool,
                            indent_space_count: Count) -> str:
     config_node = _create_v3_parser(file, with_pkg_include_dir, include_dirs,
-                                    ignore_include_not_found).config_node
+                                    ignore_include_not_found).root_node
     return barectf_config_parse_common._yaml_dump(config_node, indent=indent_space_count,
                                                   default_flow_style=False, explicit_start=True,
                                                   explicit_end=True)
index 4af8121955e9c6df7e6571da887876b7f4f8bcb9..61fff44c30637c634a734d054c90fca974e0cd60 100644 (file)
@@ -358,6 +358,10 @@ class _Parser:
         self._schema_validator = _SchemaValidator({'config/common', f'config/{major_version}'})
         self._major_version = major_version
 
+    @property
+    def root_node(self):
+        return self._root_node
+
     @property
     def _struct_ft_node_members_prop_name(self) -> str:
         if self._major_version == 2:
This page took 0.024278 seconds and 4 git commands to generate.