Przeglądaj źródła

pygrass manual: cosmetics

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@62323 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 10 lat temu
rodzic
commit
96b06ac7c1

+ 1 - 1
lib/python/docs/src/index.rst

@@ -4,7 +4,7 @@ GRASS GIS Python library documentation
 Contents:
 Contents:
 
 
 .. toctree::
 .. toctree::
-   :maxdepth: 2
+   :maxdepth: 3
 
 
    script
    script
    pygrass_index
    pygrass_index

+ 4 - 0
lib/python/docs/src/pygrass_gis.rst

@@ -6,6 +6,8 @@ GRASS database management
 These classes are used to manage the infrastructure
 These classes are used to manage the infrastructure
 of GRASS database: Gisdbase, Location and Mapset
 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:
 .. _Region-label:
 
 
@@ -15,3 +17,5 @@ Region management
 The Region class it is useful to obtain information
 The Region class it is useful to obtain information
 about the computational region and to change it.
 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>`_

+ 44 - 0
lib/python/docs/src/pygrass_messages.rst

@@ -4,3 +4,47 @@ PyGRASS message interface
 The PyGRASS message interface is a fast and exit-safe
 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>`_.
 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!

+ 2 - 1
lib/python/docs/src/pygrass_raster.rst

@@ -3,7 +3,8 @@
 Introduction to Raster classes
 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
 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
 of GRASS-C API. The classes use a standardized interface to keep methods

+ 5 - 5
lib/python/docs/src/pygrass_vector.rst

@@ -3,13 +3,13 @@
 Introduction to Vector classes
 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>`_
 `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`.
 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
 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:
 .. _Vector-label:
 
 
@@ -165,7 +165,6 @@ Get the number of primitives:
     5128
     5128
 
 
 
 
-
 Get the number of different feature types in the vector map: ::
 Get the number of different feature types in the vector map: ::
 
 
     >>> municip.number_of("areas")
     >>> municip.number_of("areas")
@@ -310,7 +309,6 @@ Or can list only the areas containing isles: ::
     [Area(...), ..., Area(...)]
     [Area(...), ..., Area(...)]
 
 
 
 
-
 Of course is still possible work only with a specific area, with: ::
 Of course is still possible work only with a specific area, with: ::
 
 
     >>> from pygrass.vector.geometry import Area
     >>> from pygrass.vector.geometry import Area
@@ -331,3 +329,5 @@ Now, find an area with an island inside... ::
     >>> isle = area.isles[0]
     >>> isle = area.isles[0]
     >>> isle.bbox()
     >>> isle.bbox()
     Bbox(199947.296494, 199280.969494, 754920.623987, 754351.812986)
     Bbox(199947.296494, 199280.969494, 754920.623987, 754351.812986)
+
+.. _Vector library: http://grass.osgeo.org/programming7/vectorlib.html