exectools.gtk2

Tools for running external processes in a GTK GUI.

Functions

level2tag(level)

Classes

BaseOutputHandler([logger]) Base class for output handlers
GtkBlinker()
GtkDialogLoggingHandler([dialog, parent]) GTK handler for logging message dialog
GtkLoggingHandler(textview) Custom handler for logging on GTK+ textviews
GtkOutputHandler([logger, statusbar, ...]) GTK progress handler
GtkOutputPlane([buffer, hide_button, formats])
GtkToolController([logger]) GTK tool controller
Popen(*args, **kwargs)
StdToolController([logger]) Class for controlling command line tools.
class exectools.gtk2.GtkBlinker[source]

Bases: gtk.Image

flush()[source]

Flush the blinker

pulse()[source]

A blinker pulse

reset()[source]

Reset the blinker

class exectools.gtk2.GtkDialogLoggingHandler(dialog=None, parent=None)[source]

Bases: logging.Handler

GTK handler for logging message dialog

emit(record)[source]
levelsmap = {0: <enum GTK_MESSAGE_INFO of type GtkMessageType>, 40: <enum GTK_MESSAGE_ERROR of type GtkMessageType>, 10: <enum GTK_MESSAGE_INFO of type GtkMessageType>, 50: <enum GTK_MESSAGE_ERROR of type GtkMessageType>, 20: <enum GTK_MESSAGE_INFO of type GtkMessageType>, 30: <enum GTK_MESSAGE_WARNING of type GtkMessageType>}
class exectools.gtk2.GtkLoggingHandler(textview)[source]

Bases: logging.Handler

Custom handler for logging on GTK+ textviews

emit(record)[source]
class exectools.gtk2.GtkOutputHandler(logger=None, statusbar=None, progressbar=None, blinker=None)[source]

Bases: gobject._gobject.GObject, exectools.BaseOutputHandler

GTK progress handler

close()[source]

Force processing of all buffered data and reset the instance

feed(data)[source]

Feed some data to the parser.

It is processed insofar as it consists of complete elements; incomplete data is buffered until more data is fed or close() is called.

handle_progress(data)[source]

Handle progress data.

Parameters:data – a list containing an item for each named group in the “progress” regular expression: (pulse, percentage, text) for the default implementation. Each item can be None.
reset()[source]

Reset the handler instance.

Loses all unprocessed data. This is called implicitly at instantiation time.

class exectools.gtk2.GtkOutputPlane(buffer=None, hide_button=True, formats=None)[source]

Bases: gtk.TextView

clear()[source]
on_populate_popup(widget, menu)[source]
save()[source]
class exectools.gtk2.GtkToolController(logger=None)[source]

Bases: gobject._gobject.GObject, exectools.std.StdToolController

GTK tool controller

connect_output_handlers()[source]

Connect output handlers

finalize_run(*args, **kwargs)[source]

Perform finalization actions.

This method is called when the controlled process terminates to perform finalization actions like:

  • read and handle residual data in buffers,
  • flush and close output handlers,
  • close subprocess file descriptors
  • run the “finalize_run_hook” method
  • reset the controller instance

Additional finalization actions are performed using a custom “finalize_run_hook” instead of overriging “finalize_run”.

handle_connection_broken(*args)[source]

Handle a connection broken

handle_finished(*args)[source]

Handle process termination

handle_ioerror(*args)[source]

Handle a IO error while process execution

run_tool(tool, *args, **kwargs)[source]

Run an external tool in controlled way

The output of the child process is handled by the controller and, optionally, notifications can be achieved at sub-process termination.

class exectools.gtk2.Popen(*args, **kwargs)[source]

Bases: gobject._gobject.GObject, exectools.subprocess2.Popen

close()[source]

Get GSDView at SourceForge.net. Fast, secure and Free Open Source software downloads

Previous topic

exectools.qt4

Next topic

gsdtools

This Page