8.6.1.1. pymodaq_gui.editor.monaco module

class pymodaq_gui.editor.monaco.FileStatus(path, unsaved=False)[source]

Bases: object

path: Path
unsaved: bool = False
class pymodaq_gui.editor.monaco.MonacoApp(parent=None)[source]

Bases: CustomApp

Attributes:
current_editor

Get the editor in the currently opened tab

current_file
files_path

Get the list of all opened files in the order of the displayed tabs

local_files_path

Get a file path to store currently opened files

local_path

Get 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

connect_things()

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

do_things_after_ui_setup()

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_file()

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_actions()

setup_docks_and_widgets()

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

static check_python_syntax_valid(file_path)[source]
add_file(file_path, display=True, add_to_watcher=True)[source]

Open and display a file content in a new editor

add_text_to_display(text)[source]
close_editor(tab_index)[source]

close the file and the editor of the given tab index

connect_things()[source]
create_file(file_path=None, add_to_watcher=True)[source]

Create a new file and display it in a new tab

create_monaco_widget(file_path)[source]
Return type:

MonacoWithFile

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 contains

  • monaco_widget (MonacoWithFile)

do_things_after_ui_setup()[source]
do_things_on_file_changed(file_path_as_str)[source]
get_editor_from_tab_index(tab_index)[source]

get the Monaco editor instance from it’s tab index

Return type:

MonacoWithFile

get_files_cache()[source]
Return type:

list[Path]

highlight_tab(tab_index)[source]
is_file_and_editor_content_same(tab_index)[source]
Return type:

bool

load_file(file_path=None)[source]

Load a new file and display it in a new tab

quit_fun()[source]
remove_file(file_path)[source]

remove the editor corresponding to the specified file Path

run_file(file_path=None)[source]
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()[source]

Save the current editor content in the corresponding file Path

save_file_as(file_path=None, add_to_watcher=True)[source]

Rename the current editor file content in a new file Path

setup_actions()[source]
setup_docks_and_widgets()[source]
setup_menus_and_toolbars(menubar=None)[source]
unsaved_tabname(file_status)[source]
property current_editor: MonacoWithFile

Get the editor in the currently opened tab

property current_file: Path
property files_path: list[Path]

Get the list of all opened files in the order of the displayed tabs

property local_files_path: Path

Get a file path to store currently opened files

property local_path: Path

Get a local file path to cache some data related to this application

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

set_saved()[source]
set_unsaved()[source]
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: object

Methods

flush

write

flush()[source]
write(text)[source]
class pymodaq_gui.editor.monaco.Runner(display)[source]

Bases: QObject

Methods

do_subprocess

do_subprocess(file_path)[source]
staticMetaObject = PySide6.QtCore.QMetaObject("Runner" inherits "QObject": )
pymodaq_gui.editor.monaco.main()[source]