GRASS Programmer's Manual  6.4.2(2012)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gui_modules.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 OnCmdDone
 Command done (or aborted)
def OnProcessPendingOutputWindowEvents

Data Fields

 panelOutput
 panelPrompt
 parent
 lineWidth
 linePos
 requestQ
 resultQ
 console_progressbar
 cmd_output
 cmd_output_timer
 cmd_prompt
 search
 infoCollapseLabelExp
 infoCollapseLabelCol
 searchPane
 cmd_stdout
 cmd_stderr
 cmdThread
 btn_console_clear
 btn_cmd_clear
 btn_console_save
 btn_abort
 history
 linepos

Detailed Description

Create and manage output console for commands run by GUI.

Definition at line 171 of file goutput.py.


Constructor & Destructor Documentation

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

Member Function Documentation

def gui_modules.goutput.GMConsole.ClearHistory (   self,
  event 
)

Clear history of commands.

Definition at line 593 of file goutput.py.

def gui_modules.goutput.GMConsole.GetCmd (   self)

Get running command or None.

Definition at line 640 of file goutput.py.

Referenced by gui_modules.render.Layer.__del__(), and gui_modules.render.Layer.SetCmd().

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

Get widget used for logging.

Parameters:
errTrue to get stderr widget

Definition at line 604 of file goutput.py.

References gui_modules.goutput.GMConsole.cmd_stderr, and gui_modules.goutput.GMConsole.cmd_stdout.

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

Get panel.

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

Definition at line 347 of file goutput.py.

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

def gui_modules.goutput.GMConsole.GetProgressBar (   self)

Return progress bar widget.

Definition at line 600 of file goutput.py.

References gui_modules.goutput.GMConsole.console_progressbar.

def gui_modules.goutput.GMConsole.OnCmdAbort (   self,
  event 
)

Abort running command.

Definition at line 734 of file goutput.py.

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

Print command output.

Definition at line 667 of file goutput.py.

References gui_modules.goutput.GMConsole.linepos.

def gui_modules.goutput.GMConsole.OnCmdProgress (   self,
  event 
)

Update progress message info.

Definition at line 730 of file goutput.py.

def gui_modules.goutput.GMConsole.OnCmdRun (   self,
  event 
)

Run command.

Definition at line 738 of file goutput.py.

References gui_modules.goutput.GMConsole.WriteCmdLog().

def gui_modules.goutput.GMConsole.OnProcessPendingOutputWindowEvents (   self,
  event 
)

Definition at line 879 of file goutput.py.

def gui_modules.goutput.GMConsole.OnSearchPaneChanged (   self,
  event 
)

Collapse search module box.

Definition at line 337 of file goutput.py.

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

def gui_modules.goutput.GMConsole.OnUpdateStatusBar (   self,
  event 
)

Update statusbar text.

Definition at line 657 of file goutput.py.

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

def gui_modules.goutput.GMConsole.Redirect (   self)
def gui_modules.goutput.GMConsole.RunCmd (   self,
  command,
  compReg = True,
  switchPage = False,
  onDone = 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
onDonefunction to be called when command is finished

Definition at line 428 of file goutput.py.

References gui_modules.goutput.GMConsole.cmd_stderr, gui_modules.goutput.GMConsole.cmd_stdout, gui_modules.psmap.OnAddLegend(), gui_modules.colorrules.ColorTable.parent, gui_modules.dbm_dialogs.DisplayAttributesDialog.parent, gui_modules.dbm.Log.parent, gui_modules.goutput.CmdThread.parent, gui_modules.dbm.VirtualAttributeList.parent, gui_modules.gcpmapdisp.MapFrame.parent, gui_modules.gcpmanager.GCPWizard.parent, gui_modules.goutput.GMConsole.parent, gui_modules.ghelp.MenuTreeWindow.parent, gui_modules.gcpmanager.LocationPage.parent, gui_modules.gcpmanager.GroupPage.parent, gui_modules.ghelp.MenuTree.parent, gui_modules.gdialogs.DecorationDialog.parent, gui_modules.dbm.AttributeManager.parent, gui_modules.gcpmanager.DispMapPage.parent, gui_modules.gmodeler.ModelFrame.parent, gui_modules.gdialogs.TextLayerDialog.parent, gui_modules.colorrules.BufferedWindow.parent, gui_modules.gcpmanager.GCP.parent, gui_modules.ghelp.InstallExtensionWindow.parent, gui_modules.gdialogs.AddMapLayersDialog.parent, gui_modules.ghelp.ExtensionTree.parent, gui_modules.gdialogs.ImportDialog.parent, gui_modules.ghelp.UninstallExtensionWindow.parent, gui_modules.ghelp.CheckListExtension.parent, gui_modules.ghelp.HelpWindow.parent, gui_modules.gdialogs.LayersList.parent, gui_modules.gdialogs.SetOpacityDialog.parent, gui_modules.gmodeler.ModelCanvas.parent, gui_modules.gdialogs.StaticWrapText.parent, gui_modules.gmodeler.ModelAction.parent, gui_modules.gdialogs.ImageSizeDialog.parent, gui_modules.gmodeler.ModelData.parent, gui_modules.gmodeler.ModelDataDialog.parent, gui_modules.dbm.TableListCtrl.parent, gui_modules.dbm.LayerListCtrl.parent, gui_modules.dbm.LayerBook.parent, gui_modules.gcpmanager.GrSettingsDialog.parent, gui_modules.gmodeler.ModelSearchDialog.parent, gui_modules.gmodeler.ModelRelation.parent, gui_modules.gmodeler.ModelRelationDialog.parent, gui_modules.gmodeler.ModelParamDialog.parent, gui_modules.gmodeler.ModelListCtrl.parent, gui_modules.gmodeler.VariablePanel.parent, gui_modules.gmodeler.ModelItem.parent, gui_modules.gmodeler.ModelItemDialog.parent, gui_modules.gmodeler.ItemPanel.parent, gui_modules.gmodeler.ItemCheckListCtrl.parent, and gui_modules.goutput.GMConsole.WriteError().

Referenced by gui_modules.goutput.GMConsole.WriteError().

def gui_modules.goutput.GMConsole.SaveHistory (   self,
  event 
)

Save history of commands.

Definition at line 614 of file goutput.py.

def gui_modules.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 644 of file goutput.py.

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

Write message in selected style.

Definition at line 413 of file goutput.py.

References gui_modules.goutput.GMConsole.WriteLog().

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

def gui_modules.goutput.GMConsole.WriteError (   self,
  line 
)

Write message in error style.

Definition at line 423 of file goutput.py.

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

Referenced by gui_modules.goutput.GMConsole.RunCmd().

def gui_modules.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 376 of file goutput.py.

References gui_modules.goutput.GMConsole.lineWidth.

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

def gui_modules.goutput.GMConsole.WriteWarning (   self,
  line 
)

Write message in warning style.

Definition at line 419 of file goutput.py.

References gui_modules.goutput.GMConsole.WriteLog().


Field Documentation

gui_modules.goutput.GMConsole.btn_abort

Definition at line 261 of file goutput.py.

gui_modules.goutput.GMConsole.btn_cmd_clear

Definition at line 254 of file goutput.py.

gui_modules.goutput.GMConsole.btn_console_clear

Definition at line 252 of file goutput.py.

gui_modules.goutput.GMConsole.btn_console_save

Definition at line 258 of file goutput.py.

gui_modules.goutput.GMConsole.cmd_output

Definition at line 212 of file goutput.py.

gui_modules.goutput.GMConsole.cmd_output_timer

Definition at line 214 of file goutput.py.

gui_modules.goutput.GMConsole.cmd_prompt

Definition at line 221 of file goutput.py.

Referenced by gui_modules.goutput.GMConsole.MakeSearchPaneContent().

gui_modules.goutput.GMConsole.cmd_stderr
gui_modules.goutput.GMConsole.cmd_stdout
gui_modules.goutput.GMConsole.cmdThread

Definition at line 247 of file goutput.py.

gui_modules.goutput.GMConsole.console_progressbar

Definition at line 204 of file goutput.py.

Referenced by gui_modules.goutput.GMConsole.GetProgressBar().

gui_modules.goutput.GMConsole.history

Definition at line 616 of file goutput.py.

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

Definition at line 193 of file goutput.py.

gui_modules.goutput.GMConsole.linepos

Definition at line 689 of file goutput.py.

Referenced by gui_modules.goutput.GMConsole.OnCmdOutput().

gui_modules.goutput.GMConsole.lineWidth

Definition at line 190 of file goutput.py.

Referenced by gui_modules.goutput.GMConsole.WriteLog().

gui_modules.goutput.GMConsole.panelOutput

Definition at line 181 of file goutput.py.

Referenced by gui_modules.goutput.GMConsole.GetPanel().

gui_modules.goutput.GMConsole.panelPrompt

Definition at line 182 of file goutput.py.

Referenced by gui_modules.goutput.GMConsole.GetPanel().

gui_modules.goutput.GMConsole.requestQ

Definition at line 198 of file goutput.py.

gui_modules.goutput.GMConsole.resultQ

Definition at line 199 of file goutput.py.

gui_modules.goutput.GMConsole.search

Definition at line 224 of file goutput.py.

Referenced by gui_modules.goutput.GMConsole.MakeSearchPaneContent().

gui_modules.goutput.GMConsole.searchPane

Definition at line 229 of file goutput.py.


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