GRASS Programmer's Manual  6.4.4(2014)-r
python.task Namespace Reference

Data Structures

class  grassTask
 This class holds the structures needed for filling by the parser. More...
 
class  processTask
 A ElementTree handler for the –interface-description output, as defined in grass-interface.dtd. More...
 

Functions

def get_interface_description (cmd)
 Returns the XML description for the GRASS cmd. More...
 
def parse_interface
 Parse interface of given GRASS module. More...
 
def command_info (cmd)
 Returns meta information for any GRASS command as dictionary with entries for description, keywords, usage, flags, and parameters, e.g. More...
 

Function Documentation

def python.task.command_info (   cmd)

Returns meta information for any GRASS command as dictionary with entries for description, keywords, usage, flags, and parameters, e.g.

1 >>> gtask.command_info('g.tempfile')
2 
3 {'keywords': ['general', 'map management'],
4  'params': [{'gisprompt': False, 'multiple': False, 'name': 'pid', 'guidependency': '',
5  'default': '', 'age': None, 'required': True, 'value': '',
6  'label': '', 'guisection': '', 'key_desc': [], 'values': [], 'values_desc': [],
7  'prompt': None, 'hidden': False, 'element': None, 'type': 'integer',
8  'description': 'Process id to use when naming the tempfile'}],
9  'flags': [{'description': 'Verbose module output', 'value': False, 'label': '', 'guisection': '',
10  'suppress_required': False, 'hidden': False, 'name': 'verbose'}, {'description': 'Quiet module output',
11  'value': False, 'label': '', 'guisection': '', 'suppress_required': False, 'hidden': False, 'name': 'quiet'}],
12  'description': 'Creates a temporary file and prints the file name.',
13  'usage': 'g.tempfile pid=integer [--verbose] [--quiet]'
14 }
15 
16 >>> gtask.command_info('v.buffer')['keywords']
17 
18 ['vector', 'geometry', 'buffer']

Definition at line 478 of file task.py.

References python.task.parse_interface().

def python.task.get_interface_description (   cmd)

Returns the XML description for the GRASS cmd.

The DTD must be located in $GISBASE/etc/grass-interface.dtd, otherwise the parser will not succeed.

Parameters
cmdcommand (name of GRASS module)

Definition at line 433 of file task.py.

References python.core.decode().

Referenced by python.task.parse_interface().

def python.task.parse_interface (   name,
  parser = processTask,
  blackList = None 
)

Parse interface of given GRASS module.

Parameters
namename of GRASS module to be parsed

Definition at line 463 of file task.py.

References python.core.decode(), python.task.get_interface_description(), and python.core.parser().

Referenced by python.task.command_info().