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

Data Structures

class  GError
 
class  GWarning
 
class  GMessage
 
class  GException
 
class  Popen
 Subclass subprocess.Popen. More...
 
class  Command
 Run command in separate thread. More...
 
class  CommandThread
 Create separate thread for command. More...
 

Functions

def GetRealCmd
 Return real command name - only for MS Windows. More...
 
def DecodeString
 Decode string using system encoding. More...
 
def EncodeString
 Return encoded string using system locales. More...
 
def recv_some
 
def send_all
 
def RunCommand
 Run GRASS command. More...
 
def GetDefaultEncoding
 Get default system encoding. More...
 

Variables

tuple compatPath = os.path.join(globalvar.ETCWXDIR, "compat")
 
string message = "Other end disconnected!"
 
tuple _enc = GetDefaultEncoding()
 

Function Documentation

def gcmd.DecodeString (   string)

Decode string using system encoding.

Parameters
stringstring to be decoded
Returns
decoded string

Definition at line 69 of file gcmd.py.

def gcmd.EncodeString (   string)

Return encoded string using system locales.

Parameters
stringstring to be encoded
Returns
encoded string

Definition at line 85 of file gcmd.py.

Referenced by goutput.GMStc.AddTextWrapped(), and prompt.GPrompt.GetCommandItems().

def gcmd.GetDefaultEncoding (   forceUTF8 = False)

Get default system encoding.

Parameters
forceUTF8force 'UTF-8' if encoding is not defined
Returns
system encoding (can be None)

Definition at line 701 of file gcmd.py.

def gcmd.GetRealCmd (   cmd)

Return real command name - only for MS Windows.

Definition at line 59 of file gcmd.py.

Referenced by prompt.GPromptSTC.OnKeyPressed(), forms.GUI.ParseCommand(), and RunCommand().

def gcmd.recv_some (   p,
  t = .1,
  e = 1,
  tr = 5,
  stderr = 0 
)

Definition at line 276 of file gcmd.py.

References max.

def gcmd.RunCommand (   prog,
  flags = "",
  overwrite = False,
  quiet = False,
  verbose = False,
  parent = None,
  read = False,
  stdin = None,
  getErrorMsg = False,
  kwargs 
)

Run GRASS command.

Parameters
progprogram to run
flagsflags given as a string
overwrite,quiet,verboseflags
parentparent window for error messages
readfetch stdout
stdinstdin or None
getErrorMsgget error messages on failure
kwargsprogram parameters
Returns
returncode (read == False and getErrorMsg == False)
returncode, messages (read == False and getErrorMsg == True)
stdout (read == True and getErrorMsg == False)
returncode, stdout, messages (read == True and getErrorMsg == True)
stdout, stderr

Definition at line 625 of file gcmd.py.

References GetRealCmd().

Referenced by preferences.PreferencesDialog.__init__(), gcmd.CommandThread.abort(), colorrules.VectorColorTable.AddTemporaryColumn(), manager.AttributeManager.ApplyCommands(), utils.ComputeSetRegion(), colorrules.VectorColorTable.CreateAttrTable(), colorrules.ColorTable.CreateColorTable(), profile.ProfileFrame.CreateDatalist(), dialogs.GroupDialog.CreateNewGroup(), dialogs.CreateNewVector(), colorrules.VectorColorTable.DeleteTemporaryColumn(), frame.DialogDataChanged(), mapwindow.BufferedWindow.DisplayToWind(), dialogs.GroupDialog.EditGroup(), utils.GetAllVectorLayers(), utils.GetColorTables(), preferences.DefaultFontDialog.GetFonts(), dialogs.GroupDialog.GetGroupLayers(), utils.GetListOfMapsets(), manager.GCP.GetNewExtent(), render.Map.GetRegion(), utils.GetTempfile(), utils.GetVectorNumberOfLayers(), gis_set.GRASSStartup.ImportFile(), gselect.ColumnSelect.InsertTableColumns(), gselect.TableSelect.InsertTables(), utils.ListOfMapsets(), manager.VirtualAttributeList.LoadData(), extensions.CheckListExtension.LoadData(), colorrules.VectorColorTable.LoadRulesFromColumn(), colorrules.ColorTable.LoadTable(), colorrules.VectorColorTable.OnAddColumn(), manager.LayerBook.OnAddLayer(), frame.GMFrame.OnChangeLocation(), frame.GMFrame.OnChangeMapset(), vclean.VectorCleaningFrame.OnCleaningRun(), frame.PsMapFrame.OnCmdDone(), manager.VirtualAttributeList.OnColumnCompute(), ogc_services.WMSDialog.OnConnect(), dialogs.NorthArrowDialog.OnConvergence(), frame.GMFrame.OnCreateMapset(), manager.LayerBook.OnCreateTable(), manager.AttributeManager.OnDataItemDeleteAll(), manager.LayerBook.OnDeleteLayer(), manager.AttributeManager.OnDeleteSelected(), manager.DispMapPage.OnEnterPage(), wizard.SummaryPage.OnEnterPage(), dialogs.VDigitCategoryDialog.OnFeature(), manager.GCP.OnGeorect(), toolbars.LMNvizToolbar.OnHelp(), frame.ModelFrame.OnHelp(), vclean.VectorCleaningFrame.OnHelp(), mcalc_builder.MapCalcFrame.OnHelp(), frame.OnHelp(), mapwindow.VDigitWindow.OnLeftDownAddLine(), mapwindow.VDigitWindow.OnLeftUpConnectLine(), frame.GMFrame.OnLocationWizard(), frame.GMFrame.OnMapsets(), mcalc_builder.MapCalcFrame.OnMCalcRun(), manager.LayerBook.OnModifyLayer(), wizard.DatumPage.OnPageChanging(), wizard.EPSGPage.OnPageChanging(), colorrules.RasterColorTable.OnPreview(), preferences.PreferencesBaseDialog.OnSave(), dialogs.RegionDef.OnSetButton(), gselect.GdalSelect.OnSetDsn(), dialogs.DxfImportDialog.OnSetDsn(), colorrules.ColorTable.OnSetTable(), manager.DispMapPage.OnSrcSelection(), dialogs.DisplayAttributesDialog.OnSubmit(), tools.OnSurfaceModeAll(), frame.GMFrame.OnSystemInfo(), colorrules.VectorColorTable.OnTablePreview(), extensions.UninstallExtensionWindow.OnUninstall(), sqlbuilder.SQLFrame.OnVerify(), wizard.LocationWizard.OnWizFinished(), frame.GMFrame.OnXTerm(), utils.projInfo(), render.Layer.Render(), render.Map.Render(), utils.ReprojectCoordinates(), statusbar.SbGoTo.ReprojectENToMap(), manager.GCP.RMSError(), model.Model.Run(), colorrules.ColorTable.RunHelp(), mapwindow.BufferedWindow.SaveRegion(), vinfo.VectorDBInfo.SelectFromTable(), gis_set.GRASSStartup.SetLocation(), instructions.Instruction.SetRegion(), utils.SetResolution(), manager.GCP.SetTarget(), profile.ProfileFrame.SetupProfile(), colorrules.VectorColorTable.UpdateColorColumn(), gselect.MapsetSelect.UpdateItems(), gselect.ProjSelect.UpdateItems(), and main.MapApp.watcher().

def gcmd.send_all (   p,
  data 
)

Definition at line 298 of file gcmd.py.

Variable Documentation

tuple gcmd._enc = GetDefaultEncoding()

Definition at line 715 of file gcmd.py.

tuple gcmd.compatPath = os.path.join(globalvar.ETCWXDIR, "compat")

Definition at line 42 of file gcmd.py.

string gcmd.message = "Other end disconnected!"

Definition at line 274 of file gcmd.py.