Table of Contents

Class: PipeOutputWindow PmwContribD-r2_0_1/PipeOutputWindow.py

Text window which controls background processes and their output.

A ScrolledText window which can control background processes. Each child process is run and the output is captured to the text window. Patterns can be applied. to the output so that color highlighting can be used on a line by line basis.

To create one, a GuiAppD instance must be passed in addition to the parent widget. The following services provided by the GuiAppD are used by this widget:

  • showMessage()

  • busyStart()

  • busyEnd()

Any object which can provide these same services can be used in place of an actual GuiAppD.

Options

errorhandler

a function to call when an error occurs, takes a single string as an argument

labelpos

Position of label.

logfile

a file where the output of child processes should be written (in addition to being displayed on the screen)

state

the text widget is usually created disabled

Base Classes   
Pmw.ScrolledText
Methods   
__init__
addTagStyle
changeState
closeCmdPipe
fileHandler
logText
readCmdOutput
showCmdCall
showCmdOutput
showCmdPreview
startBackgroundPipe
startFileHandler
stopFileHandler
  __init__ 
__init__ (
        self,
        parent,
        guiapp=GuiAppDServicesForPipeOutputWindow(),
        **kw,
        )

Initialize a PipeOutputWindow instance.

In addition to the constructor options listed above in the class documentation, this method takes several arguments.

Arguments

parent

Parent widget.

guiapp

Reference to a GuiAppD container.

  addTagStyle 
addTagStyle (
        self,
        tagName,
        pattern,
        )

Add a tag style recognition pattern.

Arguments

tagName

Name of the tag (must already be defined) to use.

pattern

Regular expression (re module) which matches lines that should use the tag tagName.

  changeState 
changeState ( self )

  closeCmdPipe 
closeCmdPipe ( self,  cmdPipe )

Close a command we're following.

Close a command pipe which we've been processing in the background. We also need to remove the pipe from the list of pipes to watch, and display a finished message if we were given one when the pipe was started.

  fileHandler 
fileHandler (
        self,
        pipe,
        mode,
        )

Tkinter file handle processing callback.

Exceptions   
IOError( pipe )
  logText 
logText ( self,  text )

Write text to an output log file.

Arguments

text

Content to be written to log file.

  readCmdOutput 
readCmdOutput ( self,  cmdPipe )

Read output from the command pipe.

  showCmdCall 
showCmdCall (
        self,
        command,
        preview=0,
        )

Add a command call to the command output.

Arguments

command

Shell command to be executed.

preview=0

Boolean flag indicating whether the command string should be displayed before the output.

  showCmdOutput 
showCmdOutput (
        self,
        outputText,
        writeToLog=1,
        )

Given some output text, this method will parse it and tag it to be displayed in the cmdoutput component.

  showCmdPreview 
showCmdPreview ( self,  command )

Display the command being executed.

Arguments

command

String command to be executed.

  startBackgroundPipe 
startBackgroundPipe (
        self,
        commands=None,
        completedCallback=None,
        )

Start a command in the background and capture the output.

  startFileHandler 
startFileHandler ( self,  openPipe )

Start listening to a file handle.

  stopFileHandler 
stopFileHandler ( self,  openPipe )

Stop listening to a file handle.


Table of Contents

This document was automatically generated on Mon Sep 17 17:47:46 2001 by HappyDoc version r2_0