fortrace.utility.applications.text_editor package

Submodules

fortrace.utility.applications.text_editor.gnome_text_editor module

class fortrace.utility.applications.text_editor.gnome_text_editor.GEdit(qs: QEMUMonitorSession, parent_notifier: ParentNotifier)[source]

Bases: GenericTextEditor

GNOME text editor.

Warning

Please deactivate ‘Restore previous session’ before using G Edit.

close_file()[source]

Close a tab or file.

Close the currently selected tab OR if it is the only one ‘empty it’ and show the default G Edit startup screen. If called again on the default G Edit startup screen, the editor will be closed, which is currently not handled.

open_file(path: PathLike)[source]

Open a file in a new tab (or current one, if empty) in G Edit.

The dialog starts per default in the users home directory OR if a document is open the document’s location.

Parameters:

path – absolute path to document (~ for home is supported)

fortrace.utility.applications.text_editor.notepad module

class fortrace.utility.applications.text_editor.notepad.Notepad(qs: QEMUMonitorSession, parent_notifier: ParentNotifier)[source]

Bases: GenericTextEditor

open_file(path: PathLike)[source]

Open file in text editor.

Parameters:

path – path of the file to be opened

save_as(path: PathLike, overwrite_file: bool = False)[source]

Save the currently active file to the given location.

Parameters:
  • path – destination path of the file to be saved

  • overwrite_file – should another file with the same destination address be overwritten?

fortrace.utility.applications.text_editor.text_editor module

class fortrace.utility.applications.text_editor.text_editor.GenericTextEditor(name: str, qs: QEMUMonitorSession, parent_notifier: ParentNotifier)[source]

Bases: GenericApplication

OS-independent representation of a graphical text editor.

abstractmethod open_file(path: PathLike)[source]

Open file in text editor.

Parameters:

path – path of the file to be opened

save()[source]

Save the currently active file.

Might open a ‘Save as…’ dialogue, if destination is unknown. This behavior is undefined, thus this method should not be used on newly created files without a name. Then use save_as

save_as(path: PathLike, overwrite_file: bool = False)[source]

Save the currently active file to the given location.

Parameters:
  • path – destination path of the file to be saved

  • overwrite_file – should another file with the same destination address be overwritten?

send_file(path: PathLike)[source]

Send a whole file to be typed in at the guest.

Saving must be done via save_as method.

Parameters:

path – path to the file to be sent

fortrace.utility.applications.text_editor.text_editor_factory module

fortrace.utility.applications.text_editor.text_editor_factory.get_text_editor(name: str, qs: QEMUMonitorSession, parent_notifier: ParentNotifier) GenericTextEditor[source]

Factory to create a specific text editor application object.

Parameters:
  • name – name of the application (if not included ValueError is thrown)

  • qs – handle to QEMUMonitor

  • parent_notifier – attribute of desktop environment to handle changes in windows

Returns:

Application handle to opened text editor

Module contents