GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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. More...
 
def get_error_msg
 Get error message ('' for no error) More...
 
def get_name
 Get task name. More...
 
def get_description
 Get module's description. More...
 
def get_keywords
 Get module's keywords. More...
 
def get_list_params
 Get list of parameters. More...
 
def get_list_flags
 Get list of flags. More...
 
def get_param
 Find and return a param by name. More...
 
def get_flag
 Find and return a flag by name. More...
 
def get_cmd_error
 Get error string produced by get_cmd(ignoreErrors = False) More...
 
def get_cmd
 Produce an array of command name and arguments for feeding into some execve-like command processor. More...
 
def get_options
 Get options. More...
 
def has_required
 Check if command has at least one required paramater. More...
 
def set_param
 Set param value/values. More...
 
def set_flag
 Enable / disable flag. More...
 
def set_options
 Set flags and parameters. More...
 

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.

1 blackList = {'items' : {'d.legend' : { 'flags' : ['m'],
2  'params' : [] }},
3  '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

def python.task.grassTask.define_first (   self)

Define first parameter.

Returns
name of first parameter

Definition at line 74 of file task.py.

References python.task.grassTask.firstParam, python.task.grassTask.params, histogram.HistogramFrame.params, and model.ModelParamDialog.params.

def python.task.grassTask.get_cmd (   self,
  ignoreErrors = False,
  ignoreRequired = False,
  ignoreDefault = True 
)
def python.task.grassTask.get_cmd_error (   self)

Get error string produced by get_cmd(ignoreErrors = False)

Returns
list of errors

Definition at line 176 of file task.py.

References python.task.grassTask.flags, python.task.grassTask.params, histogram.HistogramFrame.params, and model.ModelParamDialog.params.

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

def python.task.grassTask.get_error_msg (   self)

Get error message ('' for no error)

Definition at line 84 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 164 of file task.py.

References python.task.grassTask.flags.

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

def python.task.grassTask.get_keywords (   self)

Get module's keywords.

Definition at line 107 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 123 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 112 of file task.py.

References python.task.grassTask.params, histogram.HistogramFrame.params, and model.ModelParamDialog.params.

def python.task.grassTask.get_options (   self)
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 134 of file task.py.

References python.task.grassTask.params, histogram.HistogramFrame.params, model.ModelParamDialog.params, and dialogs.type.

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

def python.task.grassTask.has_required (   self)

Check if command has at least one required paramater.

Definition at line 244 of file task.py.

References python.task.grassTask.params, histogram.HistogramFrame.params, and model.ModelParamDialog.params.

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

Enable / disable flag.

Definition at line 263 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 273 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 253 of file task.py.

References python.task.grassTask.get_param().

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

Field Documentation

python.task.grassTask.blackList

Definition at line 61 of file task.py.

python.task.grassTask.description

Definition at line 54 of file task.py.

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

python.task.grassTask.errorMsg

Definition at line 58 of file task.py.

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

python.task.grassTask.firstParam

Definition at line 59 of file task.py.

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

python.task.grassTask.keywords

Definition at line 57 of file task.py.

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

python.task.grassTask.label

Definition at line 55 of file task.py.

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

python.task.grassTask.name

Definition at line 52 of file task.py.

Referenced by python.task.grassTask.get_cmd(), and python.task.grassTask.get_name().

python.task.grassTask.path

Definition at line 51 of file task.py.


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