def set_modules(self, modules=None):
        """
        Sets the modules Model nodes.

        :param modules: Modules to set.
        :type modules: list
        :return: Method success.
        :rtype: bool
        """

        node_flags = int(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
        modules = modules or self.get_modules()
        root_node = umbra.ui.nodes.DefaultNode(name="InvisibleRootNode")
        for module in modules:
            module_node = ModuleNode(module=module,
                                     name=foundations.strings.to_string(module.__name__),
                                     parent=root_node,
                                     node_flags=node_flags,
                                     attributes_flags=int(Qt.ItemIsSelectable | Qt.ItemIsEnabled))

        root_node.sort_children()

        self.__model.initialize_model(root_node)
        return True
def set_modules ( self , modules = None ) : node_flags = int ( Qt . ItemIsSelectable | Qt . ItemIsEnabled ) modules = modules or self . get_modules ( ) root_node = umbra . ui . nodes . DefaultNode ( name = "InvisibleRootNode" ) for module in modules : module_node = ModuleNode ( module = module , name = foundations . strings . to_string ( module . __name__ ) , parent = root_node , node_flags = node_flags , attributes_flags = int ( Qt . ItemIsSelectable | Qt . ItemIsEnabled ) ) root_node . sort_children ( ) self . __model . initialize_model ( root_node ) return True
Sets the modules Model nodes.

        :param modules: Modules to set.
        :type modules: list
        :return: Method success.
        :rtype: bool