GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
goutput.GMConsole Class Reference

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

Inheritance diagram for goutput.GMConsole:
Collaboration diagram for goutput.GMConsole:

Public Member Functions

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

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
 
 btnCmdProtocol
 
 cmdFileProtocol
 

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.CmdProtocolSave (   self)
Save list of manually entered commands into a text log file

Definition at line 778 of file goutput.py.

References goutput.GMConsole.cmdFileProtocol.

Referenced by goutput.GMConsole.OnCmdProtocol().

def goutput.GMConsole.GetCmd (   self)

Get running command or None.

Definition at line 684 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 638 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 376 of file goutput.py.

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

def goutput.GMConsole.GetProgressBar (   self)

Return progress bar widget.

Definition at line 634 of file goutput.py.

References goutput.GMConsole.progressbar.

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

def goutput.GMConsole.GetPrompt (   self)

Get prompt.

Definition at line 993 of file goutput.py.

References ghelp.SearchModuleWindow.cmdPrompt, and goutput.GMConsole.cmdPrompt.

def goutput.GMConsole.MakeSearchPaneContent (   self,
  pane 
)
def goutput.GMConsole.OnCmdAbort (   self,
  event 
)

Abort running command.

Definition at line 822 of file goutput.py.

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

Print command output.

Definition at line 711 of file goutput.py.

References goutput.GMConsole.linePos.

def goutput.GMConsole.OnCmdPrepare (   self,
  event 
)

Prepare for running command.

Definition at line 834 of file goutput.py.

def goutput.GMConsole.OnCmdProgress (   self,
  event 
)

Update progress message info.

Definition at line 774 of file goutput.py.

def goutput.GMConsole.OnCmdProtocol (   self,
  event = None 
)

Save commands into file.

Definition at line 798 of file goutput.py.

References goutput.GMConsole.CmdProtocolSave().

def goutput.GMConsole.OnCmdRun (   self,
  event 
)

Run command.

Definition at line 826 of file goutput.py.

References goutput.GMConsole.WriteCmdLog().

def goutput.GMConsole.OnOutputClear (   self,
  event 
)

Clear content of output window.

Definition at line 627 of file goutput.py.

def goutput.GMConsole.OnProcessPendingOutputWindowEvents (   self,
  event 
)

Definition at line 986 of file goutput.py.

def goutput.GMConsole.OnSearchPaneChanged (   self,
  event 
)

Collapse search module box.

Definition at line 366 of file goutput.py.

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

def goutput.GMConsole.OnUpdateStatusBar (   self,
  event 
)

Update statusbar text.

Definition at line 701 of file goutput.py.

Referenced by prompt.GPromptPopUp.__init__().

def goutput.GMConsole.Redirect (   self)

Redirect stdout/stderr.

Definition at line 388 of file goutput.py.

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

Referenced by goutput.GMConsole.OnCmdDone().

def goutput.GMConsole.ResetFocus (   self)

Reset focus.

Definition at line 989 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 458 of file goutput.py.

References goutput.GMConsole.cmdStdErr, goutput.GMConsole.cmdStdOut, utils.GetLayerNameFromCmd(), 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, goutput.GMConsole.parent, dialogs.ModelRelationDialog.parent, manager.LocationPage.parent, forms.UpdateQThread.parent, forms.TaskFrame.parent, dialogs.ModelItemDialog.parent, manager.GroupPage.parent, dialogs.DecorationDialog.parent, manager.AttributeManager.parent, dialogs.ModelListCtrl.parent, manager.DispMapPage.parent, ghelp.HelpWindow.parent, dialogs.TextLayerDialog.parent, forms.CmdPanel.parent, manager.GCP.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, dialogs.ImportDialog.parent, frame.PythonPanel.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, and manager.LayerBook.parent.

Referenced by goutput.GMConsole.WriteError().

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 688 of file goutput.py.

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

Write message in selected style.

Definition at line 442 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 453 of file goutput.py.

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

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 405 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 449 of file goutput.py.

References goutput.GMConsole.WriteLog().

Field Documentation

goutput.GMConsole.btnCmdAbort

Definition at line 264 of file goutput.py.

goutput.GMConsole.btnCmdClear

Definition at line 260 of file goutput.py.

goutput.GMConsole.btnCmdProtocol

Definition at line 267 of file goutput.py.

goutput.GMConsole.btnOutputClear

Definition at line 258 of file goutput.py.

goutput.GMConsole.btnOutputSave

Definition at line 262 of file goutput.py.

goutput.GMConsole.cmdBox

Definition at line 254 of file goutput.py.

goutput.GMConsole.cmdFileProtocol

Definition at line 814 of file goutput.py.

Referenced by goutput.GMConsole.CmdProtocolSave().

goutput.GMConsole.cmdOutput

Definition at line 218 of file goutput.py.

goutput.GMConsole.cmdOutputTimer

Definition at line 220 of file goutput.py.

goutput.GMConsole.cmdPrompt
goutput.GMConsole.cmdStdErr
goutput.GMConsole.cmdStdOut
goutput.GMConsole.cmdThread

Definition at line 250 of file goutput.py.

goutput.GMConsole.infoCollapseLabelCol
goutput.GMConsole.infoCollapseLabelExp
goutput.GMConsole.linePos

Definition at line 205 of file goutput.py.

Referenced by goutput.GMConsole.OnCmdOutput().

goutput.GMConsole.lineWidth

Definition at line 202 of file goutput.py.

Referenced by goutput.GMConsole.WriteLog().

goutput.GMConsole.outputBox

Definition at line 252 of file goutput.py.

goutput.GMConsole.panelOutput

Definition at line 193 of file goutput.py.

Referenced by goutput.GMConsole.GetPanel().

goutput.GMConsole.panelPrompt

Definition at line 194 of file goutput.py.

Referenced by goutput.GMConsole.GetPanel().

goutput.GMConsole.progressbar
goutput.GMConsole.requestQ

Definition at line 208 of file goutput.py.

goutput.GMConsole.resultQ

Definition at line 209 of file goutput.py.

goutput.GMConsole.search

Definition at line 231 of file goutput.py.

Referenced by goutput.GMConsole.MakeSearchPaneContent().

goutput.GMConsole.searchPane

Definition at line 236 of file goutput.py.


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