8.6.1.1. pymodaq_gui.editor.monaco module
- class pymodaq_gui.editor.monaco.MonacoApp(parent=None)[source]
Bases:
CustomApp- Attributes:
current_editorGet the editor in the currently opened tab
- current_file
files_pathGet the list of all opened files in the order of the displayed tabs
local_files_pathGet a file path to store currently opened files
local_pathGet a local file path to cache some data related to this application
Methods
add_file(file_path[, display, add_to_watcher])Open and display a file content in a new editor
close_editor(tab_index)close the file and the editor of the given tab index
create_file([file_path, add_to_watcher])Create a new file and display it in a new tab
display_file_text(text[, monaco_widget])display in the given editor the text
get_editor_from_tab_index(tab_index)get the Monaco editor instance from it's tab index
load_file([file_path])Load a new file and display it in a new tab
quit_fun()remove_file(file_path)remove the editor corresponding to the specified file Path
save_copy_file_as([file_path, add_to_watcher])Make a copy of the current editor content in a new file Path
Save the current editor content in the corresponding file Path
save_file_as([file_path, add_to_watcher])Rename the current editor file content in a new file Path
setup_menus_and_toolbars([menubar])add_text_to_display
check_python_syntax_valid
create_monaco_widget
do_things_on_file_changed
get_files_cache
highlight_tab
is_file_and_editor_content_same
run_file
run_signal
unsaved_tabname
- add_file(file_path, display=True, add_to_watcher=True)[source]
Open and display a file content in a new editor
- create_file(file_path=None, add_to_watcher=True)[source]
Create a new file and display it in a new tab
- display_file_text(text, monaco_widget=None)[source]
display in the given editor the text
- Parameters:
text (
Path|str) – if Path to a valid file, open the file and print in the editor the text it containsmonaco_widget (
MonacoWithFile)
- get_editor_from_tab_index(tab_index)[source]
get the Monaco editor instance from it’s tab index
- Return type:
- save_copy_file_as(file_path=None, add_to_watcher=True)[source]
Make a copy of the current editor content in a new file Path
- save_file_as(file_path=None, add_to_watcher=True)[source]
Rename the current editor file content in a new file Path
- property current_editor: MonacoWithFile
Get the editor in the currently opened tab
- property files_path: list[Path]
Get the list of all opened files in the order of the displayed tabs
- monaco_widget: Monaco
- run_signal
- staticMetaObject = PySide6.QtCore.QMetaObject("MonacoApp" inherits "CustomApp": Methods: #5 type=Signal, signature=run_signal(PyObject), parameters=PyObject )
- class pymodaq_gui.editor.monaco.MonacoWithFile(file_path, *args, **kwargs)[source]
Bases:
Monaco- Attributes:
- saved
- unsaved
Methods
file_status
set_saved
set_unsaved
- file_status
- property saved
- staticMetaObject = PySide6.QtCore.QMetaObject("MonacoWithFile" inherits "Monaco": Methods: #57 type=Signal, signature=file_status(PyObject), parameters=PyObject )
- property unsaved
- class pymodaq_gui.editor.monaco.Redirect(widget, autoscroll=True)[source]
Bases:
objectMethods
flush
write