cmd_script

Script-execution commands for the FABulous REPL.

Run TCL scripts through the embedded interpreter. Grouped as a CommandSet so it can be registered and, in future, managed independently of the core REPL.

Note: run_script stays on the REPL class rather than living here, because it overrides cmd2’s built-in run_script (which cmd2 also calls internally) and cmd2 forbids a CommandSet from replacing an existing command attribute.

Classes

ScriptCommandSet

Commands that execute TCL scripts from the REPL.

Module Contents

ScriptCommandSet

class ScriptCommandSet[source]

Bases: ReplCommandSet

Commands that execute TCL scripts from the REPL.

Private reference to the CLI instance in which this CommandSet running.

This will be set when the CommandSet is registered and it should be accessed by child classes using the self._cmd property.

Methods

do_run_tcl(file) None[source]

Execute TCL script relative to the project directory.

Specified by <tcl_scripts>. Use the ‘tk’ module to create TCL commands.

Also logs usage errors and file not found errors.