GRASS Programmer's Manual  6.5.svn(2012)-r51648
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
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.
def DecodeString
 Decode string using system encoding.
def EncodeString
 Return encoded string using system locales.
def recv_some
def send_all
def RunCommand
 Run GRASS command.

Variables

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

Function Documentation

def gcmd.DecodeString (   string)

Decode string using system encoding.

Parameters:
stringstring to be decoded
Returns:
decoded string

Definition at line 67 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 89 of file gcmd.py.

Referenced by goutput.GMStc.AddTextWrapped().

def gcmd.GetRealCmd (   cmd)

Return real command name - only for MS Windows.

Definition at line 57 of file gcmd.py.

Referenced by forms.GUI.ParseCommand(), and RunCommand().

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

Definition at line 280 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 618 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.GetColorTables(), preferences.DefaultFontDialog.GetFonts(), dialogs.GroupDialog.GetGroupLayers(), utils.GetListOfMapsets(), manager.GCP.GetNewExtent(), render.Map.GetRegion(), utils.GetTempfile(), utils.GetVectorNumberOfLayers(), 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(), wizard.CustomPage.OnPageChanging(), colorrules.RasterColorTable.OnPreview(), frame.GMFrame.OnRunScript(), dialogs.RegionDef.OnSetButton(), gselect.GdalSelect.OnSetDsn(), dialogs.DxfImportDialog.OnSetDsn(), manager.DispMapPage.OnSrcSelection(), gis_set.GRASSStartup.OnStart(), dialogs.DisplayAttributesDialog.OnSubmit(), tools.OnSurfaceModeAll(), 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(), 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 302 of file gcmd.py.


Variable Documentation

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

Definition at line 40 of file gcmd.py.

string gcmd.message = "Other end disconnected!"

Definition at line 278 of file gcmd.py.