Previous topic

panel

Next topic

support

gui

Top-level GUI classes.

class Executor(name='Executor')

Executes a command-line program, shows its output, and allows input.

clear()

Clear the log window.

draw(master)

Draw the Executor in the given master widget.

execute(command, callback=None)

Execute the given Command, and call the given callback when done.

kill()

Kill the currently-running command process.

notify(text)

Print a notification message to the Executor. Adds newlines and brackets.

poll()

Poll for process completion, and update the output window.

save_log()

Save log window contents to a file.

send_stdin(event)

Send text to the running program’s stdin.

write(line)

Write a line of text to the end of the log. If the line contains \r, overwrite the current line.

class Application(program, *panels)

Graphical frontend for a command-line program

Define a GUI application frontend for a command-line program.

program
Command-line program that the GUI is a frontend for
panels
One or more Panels, containing controls for the given program’s options

After defining the Application, call run() to show/execute it.

draw(master)

Draw the Application in the given master.

draw_toolbar(config_function, exit_function)

Draw a toolbar at the bottom of the application.

execute()

Run the program with all the supplied options.

get_args()

Get a list of all command-line arguments from all panels.

load_args(args)

Load settings from a list of command-line arguments.

prompt_load_script()

Prompt for script filename; reload gui with current Control settings

prompt_save_script()

Prompt for a script filename, then save the current command to that file.

reset()

Reset all controls back to their defaults.

save_exit()

Save current command to script and exit, without prompt

save_script(filename)

Save the current command as a bash script.

set_args(args)

Load application settings from a list of command-line arguments. The list of args is modified in-place; if all args are successfully parsed and loaded, the list will be empty when this method returns.

set_scriptname(name)

Set script filename. Called externally, this sets the variable that used used for save_exit() as well as the ‘initial file’ for prompt_save_script().

class GUI(title, width, height, application, **kwargs)

GUI with one or more Applications

Create a GUI for the given application.

title
Text shown in the title bar
width
Initial width of GUI window in pixels
height
Initial height of GUI window in pixels
application
Application to show in the GUI

Keywords arguments accepted:

inifile
Name of an .ini-formatted file with GUI configuration
icon
Full path to an image to use as the titlebar icon
position
position on screen: ‘+X+Y’
confirm_exit(event=None)

Exit the GUI, with confirmation prompt.

draw()

Draw widgets.

run(args=None, script='')

Run the GUI and enter the main event handler. This function does not return until the GUI is closed. args: arguments to the programe being run script: a filename to save the GUI command output to

show_config()

Open the GUI configuration dialog.