[GRASS-SVN] r62323 - grass/trunk/lib/python/docs/src
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Oct 21 07:52:47 PDT 2014
Author: neteler
Date: 2014-10-21 07:52:47 -0700 (Tue, 21 Oct 2014)
New Revision: 62323
Modified:
grass/trunk/lib/python/docs/src/index.rst
grass/trunk/lib/python/docs/src/pygrass_gis.rst
grass/trunk/lib/python/docs/src/pygrass_messages.rst
grass/trunk/lib/python/docs/src/pygrass_raster.rst
grass/trunk/lib/python/docs/src/pygrass_vector.rst
Log:
pygrass manual: cosmetics
Modified: grass/trunk/lib/python/docs/src/index.rst
===================================================================
--- grass/trunk/lib/python/docs/src/index.rst 2014-10-21 14:42:00 UTC (rev 62322)
+++ grass/trunk/lib/python/docs/src/index.rst 2014-10-21 14:52:47 UTC (rev 62323)
@@ -4,7 +4,7 @@
Contents:
.. toctree::
- :maxdepth: 2
+ :maxdepth: 3
script
pygrass_index
Modified: grass/trunk/lib/python/docs/src/pygrass_gis.rst
===================================================================
--- grass/trunk/lib/python/docs/src/pygrass_gis.rst 2014-10-21 14:42:00 UTC (rev 62322)
+++ grass/trunk/lib/python/docs/src/pygrass_gis.rst 2014-10-21 14:52:47 UTC (rev 62323)
@@ -6,6 +6,8 @@
These classes are used to manage the infrastructure
of GRASS database: Gisdbase, Location and Mapset
+Details about the GRASS GIS database management (locations and mapsets)
+can be found in the `GRASS GIS 7 User's Manual: GRASS GIS Quickstart <http://grass.osgeo.org/grass71/manuals/helptext.html>`_
.. _Region-label:
@@ -15,3 +17,5 @@
The Region class it is useful to obtain information
about the computational region and to change it.
+Details about the GRASS GIS computational region management can be found
+in the `GRASS GIS Wiki: Computational region <http://grasswiki.osgeo.org/wiki/Computational_region>`_
Modified: grass/trunk/lib/python/docs/src/pygrass_messages.rst
===================================================================
--- grass/trunk/lib/python/docs/src/pygrass_messages.rst 2014-10-21 14:42:00 UTC (rev 62322)
+++ grass/trunk/lib/python/docs/src/pygrass_messages.rst 2014-10-21 14:52:47 UTC (rev 62323)
@@ -4,3 +4,47 @@
The PyGRASS message interface is a fast and exit-safe
interface to the `GRASS C-library message functions <http://grass.osgeo.org/programming7/gis_2error_8c.html>`_.
+This class implements a fast and exit-safe interface to the GRASS
+C-library message functions like: G_message(), G_warning(),
+G_important_message(), G_verbose_message(), G_percent() and G_debug().
+
+Usage:
+
+ >>> msgr = Messenger()
+ >>> msgr.debug(0, "debug 0")
+ >>> msgr.verbose("verbose message")
+ >>> msgr.message("message")
+ >>> msgr.important("important message")
+ >>> msgr.percent(1, 1, 1)
+ >>> msgr.warning("Ohh")
+ >>> msgr.error("Ohh no")
+
+ >>> msgr = Messenger()
+ >>> msgr.fatal("Ohh no no no!")
+ Traceback (most recent call last):
+ File "__init__.py", line 239, in fatal
+ sys.exit(1)
+ SystemExit: 1
+
+ >>> msgr = Messenger(raise_on_error=True)
+ >>> msgr.fatal("Ohh no no no!")
+ Traceback (most recent call last):
+ File "__init__.py", line 241, in fatal
+ raise FatalError(message)
+ FatalError: Ohh no no no!
+
+ >>> msgr = Messenger(raise_on_error=True)
+ >>> msgr.set_raise_on_error(False)
+ >>> msgr.fatal("Ohh no no no!")
+ Traceback (most recent call last):
+ File "__init__.py", line 239, in fatal
+ sys.exit(1)
+ SystemExit: 1
+
+ >>> msgr = Messenger(raise_on_error=False)
+ >>> msgr.set_raise_on_error(True)
+ >>> msgr.fatal("Ohh no no no!")
+ Traceback (most recent call last):
+ File "__init__.py", line 241, in fatal
+ raise FatalError(message)
+ FatalError: Ohh no no no!
Modified: grass/trunk/lib/python/docs/src/pygrass_raster.rst
===================================================================
--- grass/trunk/lib/python/docs/src/pygrass_raster.rst 2014-10-21 14:42:00 UTC (rev 62322)
+++ grass/trunk/lib/python/docs/src/pygrass_raster.rst 2014-10-21 14:52:47 UTC (rev 62323)
@@ -3,7 +3,8 @@
Introduction to Raster classes
==============================
-Details about the architecture can be found in the `GRASS GIS 7 Programmer's Manual: GRASS Raster Library <http://grass.osgeo.org/programming7/rasterlib.html>`_
+Details about the GRASS GIS raster architecture can be found in the
+`GRASS GIS 7 Programmer's Manual: GRASS Raster Library <http://grass.osgeo.org/programming7/rasterlib.html>`_
PyGRASS uses 4 different Raster classes, that respect the 4 different approaches
of GRASS-C API. The classes use a standardized interface to keep methods
Modified: grass/trunk/lib/python/docs/src/pygrass_vector.rst
===================================================================
--- grass/trunk/lib/python/docs/src/pygrass_vector.rst 2014-10-21 14:42:00 UTC (rev 62322)
+++ grass/trunk/lib/python/docs/src/pygrass_vector.rst 2014-10-21 14:52:47 UTC (rev 62323)
@@ -3,13 +3,13 @@
Introduction to Vector classes
==============================
-Details about the GRASS vector architecture can be found in the
+Details about the GRASS GIS vector architecture can be found in the
`GRASS GIS 7 Programmer's Manual: GRASS Vector Library <http://grass.osgeo.org/programming7/vectorlib.html>`_
PyGrass has two classes for vector maps: :ref:`Vector-label` and :ref:`VectorTopo-label`.
As the names suggest, the Vector class is for vector maps, while VectorTopo
-opens vector maps with GRASS topologies. VectorTopo is an extension
-of the Vector class, so supports all the Vector class methods, with additions.
+opens vector maps with `GRASS GIS topology <http://grass.osgeo.org/programming7/vlibTopology.html>`_.
+VectorTopo is an extension of the Vector class, so supports all the Vector class methods, with additions.
.. _Vector-label:
@@ -165,7 +165,6 @@
5128
-
Get the number of different feature types in the vector map: ::
>>> municip.number_of("areas")
@@ -310,7 +309,6 @@
[Area(...), ..., Area(...)]
-
Of course is still possible work only with a specific area, with: ::
>>> from pygrass.vector.geometry import Area
@@ -331,3 +329,5 @@
>>> isle = area.isles[0]
>>> isle.bbox()
Bbox(199947.296494, 199280.969494, 754920.623987, 754351.812986)
+
+.. _Vector library: http://grass.osgeo.org/programming7/vectorlib.html
More information about the grass-commit
mailing list