|
GRASS Programmer's Manual
6.5.svn(2012)-r51648
|
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 | |
Create and manage output console for commands run by GUI.
Definition at line 183 of file goutput.py.
| 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().
| 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.
| err | True 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.
| prompt | get prompt / output panel |
Definition at line 360 of file goutput.py.
References goutput.GMConsole.panelOutput, and goutput.GMConsole.panelPrompt.
| def goutput.GMConsole.GetProgressBar | ( | self | ) |
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.MakeSearchPaneContent | ( | self, | |
| pane | |||
| ) |
Create search pane.
Definition at line 338 of file goutput.py.
References ghelp.SearchModuleWindow.cmdPrompt, goutput.GMConsole.cmdPrompt, ghelp.SearchModuleWindow.search, dialogs.ModelSearchDialog.search, ghelp.MenuTreeWindow.search, and goutput.GMConsole.search.
| def goutput.GMConsole.OnCmdAbort | ( | self, | |
| event | |||
| ) |
Abort running command.
Definition at line 749 of file goutput.py.
| def goutput.GMConsole.OnCmdDone | ( | self, | |
| event | |||
| ) |
Command done (or aborted)
Definition at line 768 of file goutput.py.
References utils.GetLayerNameFromCmd(), goutput.GMConsole.Redirect(), goutput.GMConsole.WriteCmdLog(), and goutput.GMConsole.WriteLog().
| 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 | |||
| ) |
| def goutput.GMConsole.OnProcessPendingOutputWindowEvents | ( | self, | |
| event | |||
| ) |
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().
| def goutput.GMConsole.Redirect | ( | self | ) |
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().
| def goutput.GMConsole.ResetFocus | ( | self | ) |
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).
| command | command given as a list (produced e.g. by utils.split()) |
| compReg | True use computation region |
| switchPage | switch to output page |
| skipInterface | True to do not launch GRASS interface parser when command has no arguments given |
| onDone | function to be called when command is finished |
| onPrepare | function to be called before command is launched |
| userData | data 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.
| copy | True 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.
| line | text line |
| style | text style (see GMStc) |
| stdout | write 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().
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 228 of file goutput.py.
Referenced by goutput.GMConsole.MakeSearchPaneContent().
Definition at line 247 of file goutput.py.
Referenced by goutput.GMConsole.GetLog(), goutput.GMConsole.Redirect(), and goutput.GMConsole.RunCmd().
Definition at line 246 of file goutput.py.
Referenced by goutput.GMConsole.GetLog(), goutput.GMConsole.Redirect(), and goutput.GMConsole.RunCmd().
Definition at line 250 of file goutput.py.
Definition at line 631 of file goutput.py.
Definition at line 235 of file goutput.py.
Referenced by goutput.GMConsole.OnSearchPaneChanged(), and dialogs.RegionDef.OnSettings3DPaneChanged().
Definition at line 234 of file goutput.py.
Referenced by goutput.GMConsole.OnSearchPaneChanged(), and dialogs.RegionDef.OnSettings3DPaneChanged().
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 197 of file goutput.py.
Referenced by wxdigit.VDigitError.Database(), wxdigit.VDigitError.DbExecute(), wxdigit.VDigitError.DbLink(), wxdigit.VDigitError.DeadLine(), wxdigit.VDigitError.Driver(), wxdigit.VDigitError.FeatureType(), colorrules.RulesPanel.LoadRules(), wxdigit.VDigitError.NoMap(), frame.PsMapBufferedWindow.OnLeftUp(), toolbars.VDigitToolbar.OnSelectMap(), gselect.GdalSelect.OnSetDsn(), toolbars.LMNvizToolbar.OnSettings(), toolbars.VDigitToolbar.OnSettings(), toolbars.BaseToolbar.OnTool(), toolbars.VDigitToolbar.OnZBulk(), wxdigit.VDigitError.ReadLine(), goutput.GMConsole.RunCmd(), toolbars.VDigitToolbar.StopEditing(), colorrules.VectorColorTable.UpdateColorColumn(), mapwindow.BufferedWindow.UpdateMap(), and wxdigit.VDigitError.WriteLine().
Definition at line 212 of file goutput.py.
Referenced by statusbar.SbManager.GetProgressBar(), goutput.GMConsole.GetProgressBar(), and mapwindow.NvizThread.run().
Definition at line 208 of file goutput.py.
Definition at line 209 of file goutput.py.
Definition at line 231 of file goutput.py.
Referenced by goutput.GMConsole.MakeSearchPaneContent().
Definition at line 236 of file goutput.py.