GRASS Programmer's Manual  6.4.2(2012)
python.task.grassTask Class Reference

This class holds the structures needed for filling by the parser. More...

Public Member Functions

def __init__
def define_first
 Define first parameter.
def get_error_msg
 Get error message ('' for no error)
def get_name
 Get task name.
def get_description
 Get module's description.
def get_keywords
 Get module's keywords.
def get_list_params
 Get list of parameters.
def get_list_flags
 Get list of flags.
def get_param
 Find and return a param by name.
def get_flag
 Find and return a flag by name.
def getCmdError
 Get error string produced by getCmd(ignoreErrors = False)
def getCmd
 Produce an array of command name and arguments for feeding into some execve-like command processor.
def get_options
 Get options.
def has_required
 Check if command has at least one required paramater.
def set_param
 Set param value/values.
def set_flag
 Enable / disable flag.
def set_options
 Set flags and parameters.

Data Fields

 path
 name
 params
 description
 label
 flags
 keywords
 errorMsg
 firstParam
 blackList

Detailed Description

This class holds the structures needed for filling by the parser.

Parameter blackList is a dictionary with fixed structure, eg.

blackList = {'items' : {'d.legend' : { 'flags' : ['m'],
                                       'params' : [] }},
             'enabled': True}
Parameters:
pathfull path
blackListhide some options in the GUI (dictionary)

Definition at line 35 of file task.py.


Constructor & Destructor Documentation

def python.task.grassTask.__init__ (   self,
  path = None,
  blackList = None 
)

Definition at line 50 of file task.py.


Member Function Documentation

Get error message ('' for no error)

Definition at line 80 of file task.py.

References python.task.grassTask.errorMsg.

def python.task.grassTask.get_flag (   self,
  aFlag 
)

Find and return a flag by name.

Raises ValueError when the flag is not found.

Parameters:
aFlagname of the flag

Definition at line 160 of file task.py.

References python.task.grassTask.flags.

Referenced by python.task.grassTask.set_flag().

Get module's keywords.

Definition at line 103 of file task.py.

References python.task.grassTask.keywords.

def python.task.grassTask.get_list_flags (   self,
  element = 'name' 
)

Get list of flags.

Parameters:
elementelement name

Definition at line 119 of file task.py.

References python.task.grassTask.flags.

def python.task.grassTask.get_list_params (   self,
  element = 'name' 
)

Get list of parameters.

Parameters:
elementelement name

Definition at line 108 of file task.py.

References python.task.grassTask.params, gui_modules.histogram.HistFrame.params, and gui_modules.gmodeler.ModelParamDialog.params.

def python.task.grassTask.get_param (   self,
  value,
  element = 'name',
  raiseError = True 
)

Find and return a param by name.

Parameters:
valueparam's value
elementelement name
raiseErrorTrue for raise on error

Definition at line 130 of file task.py.

References python.task.grassTask.params, gui_modules.histogram.HistFrame.params, gui_modules.gmodeler.ModelParamDialog.params, and gui_modules::psmap_dialogs.type.

Referenced by python.task.grassTask.set_param().

def python.task.grassTask.getCmd (   self,
  ignoreErrors = False,
  ignoreRequired = False 
)

Produce an array of command name and arguments for feeding into some execve-like command processor.

Parameters:
ignoreErrorsTrue to return whatever has been built so far, even though it would not be a correct command for GRASS
ignoreRequiredTrue to ignore required flags, otherwise '<required>' is shown

Definition at line 194 of file task.py.

References python.task.grassTask.flags, python.task.grassTask.getCmdError(), @1.name, locale.name, _item_.name, ellps_list.name, _pad_.name, COLUMN.name, datum_list.name, table.name, paper.name, python.task.grassTask.name, fileinfo.name, gui_modules.render.Layer.name, gui_modules.gdialogs.DecorationDialog.name, gui_modules.gmodeler.PropertiesDialog.name, gui_modules.gmodeler.VariablePanel.name, python.task.grassTask.params, gui_modules.histogram.HistFrame.params, and gui_modules.gmodeler.ModelParamDialog.params.

Get error string produced by getCmd(ignoreErrors = False)

Returns:
list of errors

Definition at line 172 of file task.py.

References python.task.grassTask.flags, python.task.grassTask.params, gui_modules.histogram.HistFrame.params, and gui_modules.gmodeler.ModelParamDialog.params.

Referenced by python.task.grassTask.getCmd().

Check if command has at least one required paramater.

Definition at line 236 of file task.py.

References python.task.grassTask.params, gui_modules.histogram.HistFrame.params, and gui_modules.gmodeler.ModelParamDialog.params.

def python.task.grassTask.set_flag (   self,
  aFlag,
  aValue,
  element = 'value' 
)

Enable / disable flag.

Definition at line 255 of file task.py.

References python.task.grassTask.get_flag().

Referenced by python.task.grassTask.set_options().

def python.task.grassTask.set_options (   self,
  opts 
)

Set flags and parameters.

Parameters:
optslist of flags and parameters

Definition at line 265 of file task.py.

References python.task.grassTask.set_flag(), and python.task.grassTask.set_param().

def python.task.grassTask.set_param (   self,
  aParam,
  aValue,
  element = 'value' 
)

Set param value/values.

Definition at line 245 of file task.py.

References python.task.grassTask.get_param().

Referenced by python.task.grassTask.set_options().


Field Documentation

Definition at line 50 of file task.py.

Definition at line 50 of file task.py.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines