Ejemplo n.º 1
0
    def update(cls):
        """reread yaml text and update node tree"""
        cls.notification_handler.clear()
        cls.root = cls.loader.load(cls.document)
        cls.autocomplete_helper.clear_anchors()
        for anchor in cls.loader.anchors:
            cls.autocomplete_helper.register_anchor(anchor)
        cls.notifications = cls.notification_handler.notifications
        if cls.root_input_type is None or cls.root is None:
            return
        cls.root = autoconvert(cls.root, cls.root_input_type)
        cls.validator.validate(cls.root, cls.root_input_type)

        # handle parameters
        if (Project.current is not None and
                Project.current.is_abs_path_in_project_dir(cls.curr_file)):
            Project.current.merge_params(cls.validator.params)

        StructureAnalyzer.add_node_info(cls.document, cls.root, cls.notification_handler)
        cls.notifications = cls.notification_handler.notifications
Ejemplo n.º 2
0
 def refresh(self, root_input_type, yaml, notification_handler, loader):
     notification_handler.clear()
     root = loader.load(yaml)
     autoconvert(root, root_input_type)
     lines = yaml.splitlines(False)        
     return root,  lines