Beispiel #1
0
 def construct_mapping(self, node, deep=False):
     """
     Wrap the base Constructor from yaml into DysonMapping, and construct the map
     :param node: the node
     :param deep: whether to traverse
     :return: the mapping object
     """
     m = DysonMapping(super(Constructor, self).construct_mapping(node, deep))
     m.dyson_pos = self._node_pos_info(node)
     return m
Beispiel #2
0
 def construct_yaml_map(self, node):
     """
     Override Constructor#construct_yaml_map
     :param node: the node
     """
     data = DysonMapping()
     yield data
     v = self.construct_mapping(node, deep=False)
     data.update(v)
     data.dyson_pos = self._node_pos_info(node)