4.17. umbra.components.factory.scriptEditor.models — Umbra 1.0.8 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Umbra 1.0.8 documentation »
- 4. Api »

# 4.17. umbra.components.factory.scriptEditor.models

models.py

Platform:
  Windows, Linux, Mac Os X.
Description:
  This module defines the `umbra.components.factory.scriptEditor.scriptEditor.ScriptEditor` Component Interface class Models.

Others:

## 4.17.1. Module Attributes

`umbra.components.factory.scriptEditor.models.` `LOGGER`

## 4.17.2. Classes

class `umbra.components.factory.scriptEditor.models.` `ProjectsModel`(parent=None, rootNode=None, horizontalHeaders=None, verticalHeaders=None, defaultNode=None, defaultProject=None)

  Bases: `umbra.ui.models.GraphModel`

  This class defines the Model used by `umbra.components.factory.scriptEditor.scriptEditor.ScriptEditor` Component Interface class.

  Parameters: | defaultProject – Default project name. ( String ) parent – Object parent. ( QObject ) rootNode – Root node. ( AbstractCompositeNode ) horizontalHeaders – Headers. ( OrderedDict ) verticalHeaders – Headers. ( OrderedDict ) defaultNode – Default node. ( GraphModelNode )

  `fileRegistered`

    This signal is emited by the `ProjectsModel` class when a file is registered. ( pyqtSignal )

    Returns: | Registered file FileNode. ( FileNode )

  `fileUnregistered`

    This signal is emited by the `ProjectsModel` class when a file is unregistered. ( pyqtSignal )

    Returns: | Unregistered file FileNode. ( FileNode )

  `editorRegistered`

    This signal is emited by the `ProjectsModel` class when an editor is registered. ( pyqtSignal )

    Returns: | Registered editor EditorNode. ( EditorNode )

  `editorUnregistered`

    This signal is emited by the `ProjectsModel` class when an editor is unregistered. ( pyqtSignal )

    Returns: | Unregistered editor EditorNode. ( EditorNode )

  `directoryRegistered`

    This signal is emited by the `ProjectsModel` class when a directory is registered. ( pyqtSignal )

    Returns: | Registered directory DirectoryNode. ( DirectoryNode )

  `directoryUnregistered`

    This signal is emited by the `ProjectsModel` class when a directory is unregistered. ( pyqtSignal )

    Returns: | Unregistered directory DirectoryNode. ( DirectoryNode )

  `projectRegistered`

    This signal is emited by the `ProjectsModel` class when a project is registered. ( pyqtSignal )

    Returns: | Registered project ProjectNode. ( ProjectNode )

  `projectUnregistered`

    This signal is emited by the `ProjectsModel` class when a project is unregistered. ( pyqtSignal )

    Returns: | Unregistered project ProjectNode. ( ProjectNode )

  `defaultProject`

    This method is the property for self.__defaultProject attribute.

    Returns: | self.__defaultProject. ( String )

  `defaultProjectNode`

    This method is the property for self.__defaultProjectNode attribute.

    Returns: | self.__defaultProjectNode. ( String )

  `listEditorNodes`(node=None)

    This method returns the Model `umbra.components.factory.scriptEditor.nodes.EditorNode` class nodes.

    Parameters: | node – Node to start walking from. ( AbstractNode / AbstractCompositeNode / Object )
    Returns: | EditorNode nodes. ( List )

  `listFileNodes`(node=None)

    This method returns the Model `umbra.components.factory.scriptEditor.nodes.FileNode` class nodes.

    Parameters: | node – Node to start walking from. ( AbstractNode / AbstractCompositeNode / Object )
    Returns: | FileNode nodes. ( List )

  `listDirectoryNodes`()

    This method returns the Model `umbra.components.factory.scriptEditor.nodes.DirectoryNode` class nodes.

    Returns: | DirectoryNode nodes. ( List )

  `listProjectNodes`(ignoreDefaultProjectNode=True)

    This method returns the Model `umbra.components.factory.scriptEditor.nodes.ProjectNode` class nodes.

    Parameters: | ignoreDefaultProjectNode – Default ProjectNode will be ignored. ( Boolean )
    Returns: | ProjectNode nodes. ( List )

  `listEditors`(node=None)

    This method returns the Model editors.

    Parameters: | node – Node to start walking from. ( AbstractNode / AbstractCompositeNode / Object )
    Returns: | Editors. ( List )

  `listFiles`(node=None)

    This method returns the Model files.

    Parameters: | node – Node to start walking from. ( AbstractNode / AbstractCompositeNode / Object )
    Returns: | FileNode nodes. ( List )

  `listDirectories`()

    This method returns the Model directories.

    Returns: | DirectoryNode nodes. ( List )

  `listProjects`(ignoreDefaultProjectNode=True)

    This method returns the Model projects.

    Parameters: | ignoreDefaultProjectNode – Default ProjectNode will be ignored. ( Boolean )
    Returns: | ProjectNode nodes. ( List )

  `getEditorNodes`(editor, node=None)

    This method returns the `umbra.components.factory.scriptEditor.nodes.EditorNode` class Nodes with given editor.

    Parameters: | node – Node to start walking from. ( AbstractNode / AbstractCompositeNode / Object ) editor – Editor. ( Editor )
    Returns: | EditorNode nodes. ( List )

  `getFileNodes`(path, node=None)

    This method returns the `umbra.components.factory.scriptEditor.nodes.FileNode` class Nodes with given path.

    Parameters: | node – Node to start walking from. ( AbstractNode / AbstractCompositeNode / Object ) path – File path. ( String )
    Returns: | FileNode nodes. ( List )

  `getDirectoryNodes`(path)

    This method returns the `umbra.components.factory.scriptEditor.nodes.DirectoryNode` class Nodes with given path.

    Parameters: | path – Directory path. ( String )
    Returns: | DirectoryNode nodes. ( List )

  `getProjectNodes`(path)

    This method returns the `umbra.components.factory.scriptEditor.nodes.ProjectNode` class Nodes with given path.

    Parameters: | path – Project path. ( String )
    Returns: | ProjectNode nodes. ( List )

  `moveNode`(parent, fromIndex, toIndex)

    This method moves given parent child to given index.

    Parameters: | toIndex – Index to. ( Integer ) fromIndex – Index from. ( Integer )
    Returns: | Method success. ( Boolean )

  `registerFile`(file, parent, ensureUniqueness=False)

    This method registers given file in the Model.

    Parameters: | file – File to register. ( String ) parent – FileNode parent. ( GraphModelNode ) ensureUniqueness – Ensure registrar uniqueness. ( Boolean )
    Returns: | FileNode. ( FileNode )

  `unregisterFile`(fileNode, raiseException=False)

    This method unregisters given `umbra.components.factory.scriptEditor.nodes.FileNode` class Node from the Model.

    Parameters: | fileNode – FileNode to unregister. ( FileNode ) raiseException – Raise the exception. ( Boolean )
    Returns: | FileNode. ( FileNode )

  `registerDirectory`(directory, parent, ensureUniqueness=False)

    This method registers given directory in the Model.

    Parameters: | directory – Directory to register. ( String ) parent – DirectoryNode parent. ( GraphModelNode ) ensureUniqueness – Ensure registrar uniqueness. ( Boolean )
    Returns: | DirectoryNode. ( DirectoryNode )

  `unregisterDirectory`(directoryNode, raiseException=False)

    This method unregisters given `umbra.components.factory.scriptEditor.nodes.DirectoryNode` class Node from the Model.

    Parameters: | directoryNode – DirectoryNode to unregister. ( DirectoryNode ) raiseException – Raise the exception. ( Boolean )
    Returns: | DirectoryNode. ( DirectoryNode )

  `registerEditor`(editor, parent, ensureUniqueness=False)

    This method registers given `umbra.components.factory.scriptEditor.editor.Editor` class editor in the Model.

    Parameters: | editor – Editor to register. ( Editor ) parent – EditorNode parent. ( GraphModelNode ) ensureUniqueness – Ensure registrar uniqueness. ( Boolean )
    Returns: | EditorNode. ( EditorNode )

  `unregisterEditor`(editorNode, raiseException=False)

    This method unregisters given `umbra.components.factory.scriptEditor.nodes.EditorNode` class Node from the Model.

    Parameters: | editorNode – EditorNode to unregister. ( EditorNode ) raiseException – Raise the exception. ( Boolean )
    Returns: | EditorNode. ( EditorNode )

  `registerProject`(path, ensureUniqueness=False)

    This method registers given path in the Model as a project.

    Parameters: | path – Project path to register. ( String ) ensureUniqueness – Ensure registrar uniqueness. ( Boolean )
    Returns: | ProjectNode. ( ProjectNode )

  `unregisterProject`(projectNode, raiseException=False)

    This method unregisters given `umbra.components.factory.scriptProject.nodes.ProjectNode` class Node from the Model.

    Parameters: | projectNode – ProjectNode to unregister. ( ProjectNode ) raiseException – Raise the exception. ( Boolean )
    Returns: | ProjectNode. ( ProjectNode )

  `isAuthoringNode`(node)

    This method returns if given Node is an authoring node.

    Parameters: | node – Node. ( ProjectNode / DirectoryNode / FileNode )
    Returns: | Is authoring node. ( Boolean )

  `setAuthoringNodes`(editor)

    This method sets the Model authoring Nodes using given editor.

    Parameters: | editor – Editor to set. ( Editor )
    Returns: | Method success. ( Boolean )

  `deleteAuthoringNodes`(editor)

    This method deletes the Model authoring Nodes associated with given editor.

    Parameters: | editor – Editor. ( Editor )
    Returns: | Method success. ( Boolean )

  `updateAuthoringNodes`(editor)

    This method updates given editor Model authoring nodes.

    Parameters: | editor – Editor. ( Editor )
    Returns: | Method success. ( Boolean )

  `setProjectNodes`(rootNode, maximumDepth=1)

    This method sets the project Model children Nodes using given root node.

    Parameters: | rootNode – Root node. ( ProjectNode / DirectoryNode ) maximumDepth – Maximum nodes nesting depth. ( Integer )

  `deleteProjectNodes`(node)

    This method deletes the Model project Nodes associated with given node.

    Parameters: | node – Node. ( ProjectNode )

  `unregisterProjectNodes`(node)

    This method unregisters given Node children.

    Parameters: | node – Node. ( ProjectNode / DirectoryNode )

  `updateProjectNodes`(node)

    This method updates given root Node children.

    Parameters: | node – Node. ( ProjectNode / DirectoryNode )

class `umbra.components.factory.scriptEditor.models.` `LanguagesModel`(parent=None, languages=None)

  Bases: `PyQt4.QtCore.QAbstractListModel`

  This class is a QAbstractListModel subclass used to store the `umbra.components.factory.scriptEditor.scriptEditor.ScriptEditor` Component Interface class languages.

  Parameters: | parent – Parent object. ( QObject ) languages – Languages. ( List )

  `languages`

    This method is the property for self.__languages attribute.

    Returns: | self.__languages. ( List )

  `rowCount`(parent=<PyQt4.QtCore.QModelIndex object at 0x102717c20>)

    This method reimplements the `QAbstractListModel.rowCount()` method.

    Parameters: | parent – Parent. ( QModelIndex )
    Returns: | Row count. ( Integer )

  `data`(index, role=0)

    This method reimplements the `QAbstractListModel.data()` method.

    Parameters: | index – Index. ( QModelIndex ) role – Role. ( Integer )
    Returns: | Data. ( QVariant )

  `sortLanguages`(order=0)

    This method sorts the Model languages.

    Parameters: | order – Order. ( Qt.SortOrder )

  `registerLanguage`(language)

    This method registers given language in the `LanguagesModel.languages` class property.

    Parameters: | language – Language to register. ( Language )
    Returns: | Method success. ( Boolean )

  `unregisterLanguage`(name)

    This method unregisters language with given name from the `LanguagesModel.languages` class property.

    Parameters: | name – Language to unregister. ( String )
    Returns: | Method success. ( Boolean )

  `getLanguage`(name)

    This method returns the language with given name.

    Parameters: | name – Language name. ( String )
    Returns: | File language. ( Language )

  `getFileLanguage`(file)

    This method returns the language of given file.

    Parameters: | file – File to get language of. ( String )
    Returns: | File language. ( Language )

class `umbra.components.factory.scriptEditor.models.` `PatternsModel`(parent=None, rootNode=None, horizontalHeaders=None, verticalHeaders=None)

  Bases: `umbra.ui.models.GraphModel`

  This class defines the Model used the by `umbra.patterns.factory.scriptEditor.searchAndReplace.SearchAndReplace` class to store the search and replace patterns.

  Parameters: | parent – Object parent. ( QObject ) rootNode – Root node. ( AbstractCompositeNode ) horizontalHeaders – Headers. ( OrderedDict ) verticalHeaders – Headers. ( OrderedDict )

  `patternInserted`

    This signal is emited by the `PatternsModel` class when a pattern has been inserted. ( pyqtSignal )

    Returns: | Inserted pattern node. ( PatternNode )

  `patternRemoved`

    This signal is emited by the `PatternsModel` class when a pattern has been removed. ( pyqtSignal )

    Returns: | Removed pattern node. ( PatternNode )

  `initializeModel`(rootNode)

    This method initializes the Model using given root node.

    Parameters: | rootNode – Graph root node. ( DefaultNode )
    Returns: | Method success ( Boolean )

  `insertPattern`(pattern, index)

    This method inserts given pattern into the Model.

    Parameters: | pattern – Pattern. ( String ) index – Insertion index. ( Integer )
    Returns: | Method success. ( Boolean )

  `removePattern`(pattern)

    This method removes given pattern from the Model.

    Parameters: | pattern – Pattern. ( String )
    Returns: | Method success. ( Boolean )

class `umbra.components.factory.scriptEditor.models.` `SearchResultsModel`(parent=None, rootNode=None, horizontalHeaders=None, verticalHeaders=None, defaultNode=None)

  Bases: `umbra.ui.models.GraphModel`

  This class defines the Model used the by `umbra.patterns.factory.scriptEditor.searchInFiles.SearchInFiles` class to store the search results.

  Parameters: | parent – Object parent. ( QObject ) rootNode – Root node. ( AbstractCompositeNode ) horizontalHeaders – Headers. ( OrderedDict ) verticalHeaders – Headers. ( OrderedDict ) defaultNode – Default node. ( GraphModelNode )

  `initializeModel`(rootNode)

    This method initializes the Model using given root node.

    Parameters: | rootNode – Graph root node. ( DefaultNode )
    Returns: | Method success ( Boolean )

  `getMetrics`()

    This method returns the Model metrics.

    Returns: | Nodes metrics. ( Dictionary )

### Navigation

- index
- modules |
- next |
- previous |
- Umbra 1.0.8 documentation »
- 4. Api »