GRASS Programmer's Manual  6.5.svn(2012)-r51648
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
goutput.GMConsole Class Reference

Create and manage output console for commands run by GUI. More...

Public Member Functions

def __init__
def MakeSearchPaneContent
 Create search pane.
def OnSearchPaneChanged
 Collapse search module box.
def GetPanel
 Get panel.
def Redirect
 Redirect stdout/stderr.
def WriteLog
 Generic method for writing log message in given style.
def WriteCmdLog
 Write message in selected style.
def WriteWarning
 Write message in warning style.
def WriteError
 Write message in error style.
def RunCmd
 Run command typed into console command prompt (GPrompt).
def ClearHistory
 Clear history of commands.
def GetProgressBar
 Return progress bar widget.
def GetLog
 Get widget used for logging.
def SaveHistory
 Save history of commands.
def GetCmd
 Get running command or None.
def SetCopyingOfSelectedText
 Enable or disable copying of selected text in to clipboard.
def OnUpdateStatusBar
 Update statusbar text.
def OnCmdOutput
 Print command output.
def OnCmdProgress
 Update progress message info.
def OnCmdAbort
 Abort running command.
def OnCmdRun
 Run command.
def OnCmdPrepare
 Prepare for running command.
def OnCmdDone
 Command done (or aborted)
def OnProcessPendingOutputWindowEvents
def ResetFocus
 Reset focus.

Data Fields

 panelOutput
 panelPrompt
 parent
 lineWidth
 linePos
 requestQ
 resultQ
 progressbar
 cmdOutput
 cmdOutputTimer
 cmdPrompt
 search
 infoCollapseLabelExp
 infoCollapseLabelCol
 searchPane
 cmdStdOut
 cmdStdErr
 cmdThread
 outputBox
 cmdBox
 btnOutputClear
 btnCmdClear
 btnOutputSave
 btnCmdAbort
 history
 linepos

Detailed Description

Create and manage output console for commands run by GUI.

Definition at line 183 of file goutput.py.


Constructor & Destructor Documentation

def goutput.GMConsole.__init__ (   self,
  parent,
  id = wx.ID_ANY,
  margin = False,
  notebook = None,
  style = wx.TAB_TRAVERSAL | wx.FULL_REPAINT_ON_RESIZE,
  kwargs 
)

Definition at line 189 of file goutput.py.

References render.Layer.SetName(), and model.ModelRelation.SetName().


Member Function Documentation

def goutput.GMConsole.ClearHistory (   self,
  event 
)

Clear history of commands.

Definition at line 608 of file goutput.py.

def goutput.GMConsole.GetCmd (   self)

Get running command or None.

Definition at line 655 of file goutput.py.

Referenced by wxnviz.ImageTexture.Corresponds().

def goutput.GMConsole.GetLog (   self,
  err = False 
)

Get widget used for logging.

Parameters:
errTrue to get stderr widget

Definition at line 619 of file goutput.py.

References goutput.GMConsole.cmdStdErr, and goutput.GMConsole.cmdStdOut.

def goutput.GMConsole.GetPanel (   self,
  prompt = True 
)

Get panel.

Parameters:
promptget prompt / output panel
Returns:
wx.Panel reference

Definition at line 360 of file goutput.py.

References goutput.GMConsole.panelOutput, and goutput.GMConsole.panelPrompt.

Return progress bar widget.

Definition at line 615 of file goutput.py.

References goutput.GMConsole.progressbar.

Referenced by mapdisplay.MapFrame.OnUpdateProgress(), and frame.MapFrame.OnUpdateProgress().

def goutput.GMConsole.OnCmdAbort (   self,
  event 
)

Abort running command.

Definition at line 749 of file goutput.py.

def goutput.GMConsole.OnCmdDone (   self,
  event 
)
def goutput.GMConsole.OnCmdOutput (   self,
  event 
)

Print command output.

Definition at line 682 of file goutput.py.

References goutput.GMConsole.linepos.

def goutput.GMConsole.OnCmdPrepare (   self,
  event 
)

Prepare for running command.

Definition at line 761 of file goutput.py.

def goutput.GMConsole.OnCmdProgress (   self,
  event 
)

Update progress message info.

Definition at line 745 of file goutput.py.

def goutput.GMConsole.OnCmdRun (   self,
  event 
)

Run command.

Definition at line 753 of file goutput.py.

References goutput.GMConsole.WriteCmdLog().

Definition at line 904 of file goutput.py.

def goutput.GMConsole.OnSearchPaneChanged (   self,
  event 
)

Collapse search module box.

Definition at line 350 of file goutput.py.

References goutput.GMConsole.infoCollapseLabelCol, and goutput.GMConsole.infoCollapseLabelExp.

def goutput.GMConsole.OnUpdateStatusBar (   self,
  event 
)

Update statusbar text.

Definition at line 672 of file goutput.py.

Referenced by prompt.GPromptPopUp.__init__(), and prompt.GPrompt.OnRunCmd().

Redirect stdout/stderr.

Definition at line 372 of file goutput.py.

References goutput.GMConsole.cmdStdErr, goutput.GMConsole.cmdStdOut, and goutput.GMConsole.WriteLog().

Referenced by goutput.GMConsole.OnCmdDone().

Reset focus.

Definition at line 907 of file goutput.py.

def goutput.GMConsole.RunCmd (   self,
  command,
  compReg = True,
  switchPage = False,
  skipInterface = False,
  onDone = None,
  onPrepare = None,
  userData = None 
)

Run command typed into console command prompt (GPrompt).

Todo:
Display commands (*.d) are captured and processed separately by mapdisp.py. Display commands are rendered in map display widget that currently has the focus (as indicted by mdidx).
Parameters:
commandcommand given as a list (produced e.g. by utils.split())
compRegTrue use computation region
switchPageswitch to output page
skipInterfaceTrue to do not launch GRASS interface parser when command has no arguments given
onDonefunction to be called when command is finished
onPreparefunction to be called before command is launched
userDatadata defined for the command

Definition at line 442 of file goutput.py.

References goutput.GMConsole.cmdStdErr, goutput.GMConsole.cmdStdOut, utils.GetLayerNameFromCmd(), frame.OnAddLegend(), sqlbuilder.SQLFrame.parent, dialogs.ModelDataDialog.parent, dialogs.DisplayAttributesDialog.parent, manager.Log.parent, frame.ModelFrame.parent, goutput.CmdThread.parent, manager.VirtualAttributeList.parent, manager.GCPWizard.parent, dialogs.ModelSearchDialog.parent, forms.UpdateThread.parent, ghelp.MenuTreeWindow.parent, goutput.GMConsole.parent, dialogs.ModelRelationDialog.parent, manager.LocationPage.parent, forms.UpdateQThread.parent, ghelp.MenuTree.parent, forms.TaskFrame.parent, dialogs.ModelItemDialog.parent, manager.GroupPage.parent, dialogs.DecorationDialog.parent, manager.AttributeManager.parent, dialogs.ModelListCtrl.parent, manager.DispMapPage.parent, dialogs.TextLayerDialog.parent, forms.CmdPanel.parent, manager.GCP.parent, ghelp.HelpWindow.parent, model.ModelAction.parent, dialogs.GroupDialog.parent, dialogs.ItemCheckListCtrl.parent, frame.ModelCanvas.parent, model.ModelData.parent, dialogs.MapLayersDialog.parent, model.ModelRelation.parent, frame.VariablePanel.parent, model.ModelItem.parent, frame.ItemPanel.parent, frame.PythonPanel.parent, dialogs.ImportDialog.parent, forms.GUI.parent, dialogs.LayersList.parent, dialogs.SetOpacityDialog.parent, dialogs.ImageSizeDialog.parent, model.ModelParamDialog.parent, manager.TableListCtrl.parent, manager.LayerListCtrl.parent, manager.GrSettingsDialog.parent, manager.LayerBook.parent, and goutput.GMConsole.WriteError().

Referenced by goutput.GMConsole.WriteError().

def goutput.GMConsole.SaveHistory (   self,
  event 
)

Save history of commands.

Definition at line 629 of file goutput.py.

def goutput.GMConsole.SetCopyingOfSelectedText (   self,
  copy 
)

Enable or disable copying of selected text in to clipboard.

Effects prompt and output.

Parameters:
copyTrue for enable, False for disable

Definition at line 659 of file goutput.py.

def goutput.GMConsole.WriteCmdLog (   self,
  line,
  pid = None,
  switchPage = True 
)

Write message in selected style.

Definition at line 426 of file goutput.py.

References goutput.GMConsole.WriteLog().

Referenced by goutput.GMConsole.OnCmdDone(), and goutput.GMConsole.OnCmdRun().

def goutput.GMConsole.WriteError (   self,
  line 
)

Write message in error style.

Definition at line 437 of file goutput.py.

References goutput.GMConsole.RunCmd(), and goutput.GMConsole.WriteLog().

Referenced by goutput.GMConsole.RunCmd().

def goutput.GMConsole.WriteLog (   self,
  text,
  style = None,
  wrap = None,
  switchPage = False 
)

Generic method for writing log message in given style.

Parameters:
linetext line
styletext style (see GMStc)
stdoutwrite to stdout or stderr

Definition at line 389 of file goutput.py.

References goutput.GMConsole.lineWidth.

Referenced by goutput.GMConsole.OnCmdDone(), goutput.GMConsole.Redirect(), goutput.GMConsole.WriteCmdLog(), goutput.GMConsole.WriteError(), and goutput.GMConsole.WriteWarning().

def goutput.GMConsole.WriteWarning (   self,
  line 
)

Write message in warning style.

Definition at line 433 of file goutput.py.

References goutput.GMConsole.WriteLog().


Field Documentation

Definition at line 267 of file goutput.py.

Definition at line 260 of file goutput.py.

Definition at line 258 of file goutput.py.

Definition at line 264 of file goutput.py.

Definition at line 254 of file goutput.py.

Definition at line 218 of file goutput.py.

Definition at line 220 of file goutput.py.

Definition at line 250 of file goutput.py.

Definition at line 631 of file goutput.py.

Definition at line 205 of file goutput.py.

Definition at line 704 of file goutput.py.

Referenced by goutput.GMConsole.OnCmdOutput().

Definition at line 202 of file goutput.py.

Referenced by goutput.GMConsole.WriteLog().

Definition at line 252 of file goutput.py.

Definition at line 193 of file goutput.py.

Referenced by goutput.GMConsole.GetPanel().

Definition at line 194 of file goutput.py.

Referenced by goutput.GMConsole.GetPanel().

Definition at line 208 of file goutput.py.

Definition at line 209 of file goutput.py.

Definition at line 236 of file goutput.py.


The documentation for this class was generated from the following file: