6.46. umbra.components.factory.scriptEditor.scriptEditor

scriptEditor.py

Platform:
Windows, Linux, Mac Os X.
Description:
This module defines the ScriptEditor Component Interface class.

Others:

6.46.1. Module Attributes

umbra.components.factory.scriptEditor.scriptEditor.LOGGER
umbra.components.factory.scriptEditor.scriptEditor.COMPONENT_UI_FILE

6.46.2. Classes

class umbra.components.factory.scriptEditor.scriptEditor.ScriptEditor(parent=None, name=None, *args, **kwargs)[source]

Bases: manager.qwidgetComponent.QWidgetComponent

This class is the sibl_gui.components.addons.scriptEditor.scriptEditor Component Interface class.

Parameters:
  • parent – Object parent. ( QObject )
  • name – Component name. ( String )
  • *args – Arguments. ( * )
  • **kwargs – Keywords arguments. ( ** )
uiRefresh

This signal is emited by the ScriptEditor class when the Ui needs to be refreshed. ( pyqtSignal )

recentFilesChanged

This signal is emited by the ScriptEditor class when the recent files list has changed. ( pyqtSignal )

fileLoaded

This signal is emited by the ScriptEditor class when a file is loaded. ( pyqtSignal )

Returns:Loaded file. ( String )
fileClosed

This signal is emited by the ScriptEditor class when a file is closed. ( pyqtSignal )

Returns:Closed file. ( String )
dockArea[source]

This method is the property for self.__dockArea attribute.

Returns:self.__dockArea. ( Integer )
engine[source]

This method is the property for self.__engine attribute.

Returns:self.__engine. ( QObject )
settings[source]

This method is the property for self.__settings attribute.

Returns:self.__settings. ( QSettings )
settingsSection[source]

This method is the property for self.__settingsSection attribute.

Returns:self.__settingsSection. ( String )
developmentLayout[source]

This method is the property for self.__developmentLayout attribute.

Returns:self.__developmentLayout. ( String )
grammarsDirectory[source]

This method is the property for self.__grammarsDirectory attribute.

Returns:self.__grammarsDirectory. ( String )
extension[source]

This method is the property for self.__extension attribute.

Returns:self.__extension. ( String )
model[source]

This method is the property for self.__model attribute.

Returns:self.__model. ( ProjectsModel )
languagesModel[source]

This method is the property for self.__languagesModel attribute.

Returns:self.__languagesModel. ( LanguagesModel )
defaultProject[source]

This method is the property for self.__defaultProject attribute.

Returns:self.__defaultProject. ( String )
defaultLanguage[source]

This method is the property for self.__defaultLanguage attribute.

Returns:self.__defaultLanguage. ( String )
defaultScriptLanguage[source]

This method is the property for self.__defaultScriptLanguage attribute.

Returns:self.__defaultScriptLanguage. ( String )
defaultFileName[source]

This method is the property for self.__defaultFileName attribute.

Returns:self.__defaultFileName. ( String )
defaultFileExtension[source]

This method is the property for self.__defaultFileExtension attribute.

Returns:self.__defaultFileExtension. ( String )
defaultWindowTitle[source]

This method is the property for self.__defaultWindowTitle attribute.

Returns:self.__defaultWindowTitle. ( String )
defaultScriptEditorDirectory[source]

This method is the property for self.__defaultScriptEditorDirectory attribute.

Returns:self.__defaultScriptEditorDirectory. ( String )
defaultSessionDirectory[source]

This method is the property for self.__defaultSessionDirectory attribute.

Returns:self.__defaultSessionDirectory. ( String )
defaultScriptEditorFile[source]

This method is the property for self.__defaultScriptEditorFile attribute.

Returns:self.__defaultScriptEditorFile. ( String )
factoryDefaultScriptEditorFile[source]

This method is the property for self.__factoryDefaultScriptEditorFile attribute.

Returns:self.__factoryDefaultScriptEditorFile. ( String )
scriptEditorFile[source]

This method is the property for self.__scriptEditorFile attribute.

Returns:self.__scriptEditorFile. ( String )
maximumRecentFiles[source]

This method is the property for self.__maximumRecentFiles attribute.

Returns:self.__maximumRecentFiles. ( Integer )
recentFilesActions[source]

This method is the property for self.__recentFilesActions attribute.

Returns:self.__recentFilesActions. ( List )
searchAndReplace[source]

This method is the property for self.__searchAndReplace attribute.

Returns:self.__searchAndReplace. ( SearchAndReplace )
searchInFiles[source]

This method is the property for self.__searchInFiles attribute.

Returns:self.__searchInFiles. ( SearchInFiles )
indentWidth[source]

This method is the property for self.__indentWidth attribute.

Returns:self.__indentWidth. ( Integer )
defaultFontsSettings[source]

This method is the property for self.__defaultFontsSettings attribute.

Returns:self.__defaultFontsSettings. ( Dictionary )
console[source]

This method is the property for self.__console attribute.

Returns:self.__console. ( Dictionary )
memoryHandlerStackDepth[source]

This method is the property for self.__memoryHandlerStackDepth attribute.

Returns:self.__memoryHandlerStackDepth. ( Integer )
menuBar[source]

This method is the property for self.__menuBar attribute.

Returns:self.__menuBar. ( QToolbar )
fileMenu[source]

This method is the property for self.__fileMenu attribute.

Returns:self.__fileMenu. ( QMenu )
editMenu[source]

This method is the property for self.__editMenu attribute.

Returns:self.__editMenu. ( QMenu )
sourceMenu[source]

This method is the property for self.__sourceMenu attribute.

Returns:self.__sourceMenu. ( QMenu )
navigateMenu[source]

This method is the property for self.__navigateMenu attribute.

Returns:self.__navigateMenu. ( QMenu )
searchMenu[source]

This method is the property for self.__searchMenu attribute.

Returns:self.__searchMenu. ( QMenu )
commandMenu[source]

This method is the property for self.__commandMenu attribute.

Returns:self.__commandMenu. ( QMenu )
viewMenu[source]

This method is the property for self.__viewMenu attribute.

Returns:self.__viewMenu. ( QMenu )
activate(engine)[source]

This method activates the Component.

Parameters:engine – Container to attach the Component to. ( QObject )
Returns:Method success. ( Boolean )
deactivate()[source]

This method deactivates the Component.

Returns:Method success. ( Boolean )
initializeUi()[source]

This method initializes the Component ui.

Returns:Method success. ( Boolean )
uninitializeUi()[source]

This method uninitializes the Component ui.

Returns:Method success. ( Boolean )
addWidget()[source]

This method adds the Component Widget to the engine.

Returns:Method success. ( Boolean )
removeWidget()[source]

This method removes the Component Widget from the engine.

Returns:Method success. ( Boolean )
onStartup()[source]

This method is triggered on Framework startup.

onClose()[source]

This method is triggered on Framework close.

registerNodePath(node)[source]

This method registers given Node path in the fileSystemEventsManager.

Parameters:node – Node. ( FileNode / DirectoryNode / ProjectNode )
Returns:Method success. ( Boolean )
unregisterNodePath(node)[source]

This method unregisters given Node path from the fileSystemEventsManager..

Parameters:node – Node. ( FileNode / DirectoryNode / ProjectNode )
Returns:Method success. ( Boolean )
loadFileUi()[source]

This method loads user chosen file(s) into Script_Editor_tabWidget Widget tab Model editor(s).

Returns:Method success. ( Boolean )
Note :This method may require user interaction.
addProjectUi()[source]

This method adds user chosen project Script_Editor_tabWidget Widget tab Model.

Returns:Method success. ( Boolean )
Note :This method may require user interaction.
searchAndReplaceUi()[source]

This method performs a search and replace in the current Script_Editor_tabWidget Widget tab Model editor.

Returns:Method success. ( Boolean )
Note :This method may require user interaction.
searchInFilesUi()[source]

This method performs a search in the current user chosen files.

Returns:Method success. ( Boolean )
Note :This method may require user interaction.
getWidget(index)[source]

This method returns the Script_Editor_tabWidget Widget associated with given index.

Parameters:index – Tab index. ( Integer )
Returns:Widget. ( QWidget )
getFocusWidget()[source]

This method returns the Widget with focus.

Returns:Widget with focus. ( QWidget )
getEditorTab(editor)[source]

This method returns the Script_Editor_tabWidget Widget tab associated with the given editor.

Parameters:Editor – Editor to search tab for. ( Editor )
Returns:Tab index. ( Editor )
addEditorTab(editor)[source]

This method adds a new tab to the Script_Editor_tabWidget Widget and sets the given editor as child widget.

Parameters:editor – Editor. ( Editor )
Returns:New tab index. ( Integer )
removeEditorTab(editor)[source]

This method removes the Script_Editor_tabWidget Widget tab with given editor.

Parameters:editor – Editor. ( Editor )
Returns:Method success. ( Boolean )
findEditorTab(file)[source]

This method finds the Script_Editor_tabWidget Widget tab associated to the given file.

Parameters:file – File to search tab for. ( String )
Returns:Tab index. ( Editor )
hasEditorTab()[source]

This method returns if the Script_Editor_tabWidget Widget has at least one tab.

Returns:Has tab. ( Boolean )
getCurrentEditor()[source]

This method returns the current Script_Editor_tabWidget Widget tab Model editor.

Returns:Current editor. ( Editor )
setCurrentEditor(file)[source]

This method focus the Script_Editor_tabWidget Widget tab Model editor with given file.

Parameters:file – File. ( String )
Returns:Method success. ( Boolean )
loadPath(path)[source]

This method loads given path.

Parameters:path – Path to load. ( String )
Returns:Method success. ( Boolean )
loadDocument(document, file)[source]

This method loads given document into a new Script_Editor_tabWidget Widget tab Model editor.

Parameters:
  • document – Document to load. ( QTextDocument )
  • file – Document file. ( String )
Returns:

Method success. ( Boolean )

addProject(path)[source]

This method adds a project.

Parameters:path – Project path. ( String )
Returns:Method success. ( Boolean )
removeProject(path)[source]

This method removes a project.

Parameters:path – Project path. ( String )
Returns:Method success. ( Boolean )
newFile()[source]

This method creates a new file into a new Script_Editor_tabWidget Widget tab.

Returns:Method success. ( Boolean )
loadFile(file)[source]

This method loads user chosen file in a new Script_Editor_tabWidget Widget tab Model editor.

Parameters:file – File to load. ( String )
Returns:Method success. ( Boolean )
reloadFile(file, isModified=True)[source]

This method reloads given file Script_Editor_tabWidget Widget tab Model editor content.

Parameters:
  • file – File to reload. ( String )
  • isModified – File modified state. ( Boolean )
Returns:

Method success. ( Boolean )

saveFile(file=None)[source]

This method saves either given file or current Script_Editor_tabWidget Widget tab Model editor file.

Parameters:file – File to save. ( String )
Returns:Method success. ( Boolean )
saveFileAs()[source]

This method saves current Script_Editor_tabWidget Widget tab Model editor file as user chosen file.

Returns:Method success. ( Boolean )
saveAllFiles()[source]

This method saves all Script_Editor_tabWidget Widget tab Model editor files.

Returns:Method success. ( Boolean )
revertFile(file=None)[source]

This method reverts either given file or current Script_Editor_tabWidget Widget tab Model editor file.

Parameters:file – File to revert. ( String )
Returns:Method success. ( Boolean )
closeFile(file=None, leaveFirstEditor=True)[source]

This method closes either given file or current Script_Editor_tabWidget Widget tab Model editor file.

Parameters:
  • file – File to save. ( String )
  • leaveFirstEditor – Leave first editor. ( Boolean )
Returns:

Method success. ( Boolean )

closeAllFiles(leaveFirstEditor=True)[source]

This method closes every opened files and removes their associated Script_Editor_tabWidget Widget tabs.

Returns:Method success. ( Boolean )
closeFirstFile()[source]

This method attemtps to close the first Script_Editor_tabWidget Widget tab Model editor file.

Returns:Method success. ( Boolean )
listEditors()[source]

This method returns the Model editors.

Returns:Editors. ( List )
listFiles()[source]

This method returns the Model files.

Returns:FileNode nodes. ( List )
listDirectories()[source]

This method returns the Model directories.

Returns:DirectoryNode nodes. ( List )
listProjects(ignoreDefaultProject=True)[source]

This method returns the Model projects.

Returns:ProjectNode nodes. ( List )
getEditor(file)[source]

This method returns the Model editor associated with given file.

Parameters:file – File to search editors for. ( String )
Returns:Editor. ( Editor )
setLanguage(editor, language)[source]

This method sets given language to given Model editor.

Parameters:
  • editor – Editor to set language to. ( Editor )
  • language – Language to set. ( Language )
Returns:

Method success. ( Boolean )

gotoLine()[source]

This method moves current Script_Editor_tabWidget Widget tab Model editor cursor to user defined line.

Returns:Method success. ( Boolean )
Note :This method may require user interaction.
evaluateSelection()[source]

This method evaluates current Script_Editor_tabWidget Widget tab Model editor selected content in the interactive console.

Returns:Method success. ( Boolean )
evaluateScript()[source]

This method evaluates current Script_Editor_tabWidget Widget tab Model editor content into the interactive console.

Returns:Method success. ( Boolean )
evaluateCode(code)[source]

This method evaluates given code into the interactive console.

Parameters:code – Code to evaluate. ( String )
Returns:Method success. ( Boolean )
storeSession()[source]

This method stores the current session.

Returns:Method success. ( Boolean )
restoreSession()[source]

This method restores the stored session.

Returns:Method success. ( Boolean )
loopThroughEditors(backward=False)[source]

This method loops through the editor tabs.

Parameters:backward – Looping backward. ( Boolean )
Returns:Method success. ( Boolean )
restoreDevelopmentLayout()[source]

This definition restores the development layout.

Returns:Definition success. ( Boolean )