Преглед изворни кода

Update the docstring with the *with statement*.

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55952 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli пре 12 година
родитељ
комит
de07e06ea4
1 измењених фајлова са 15 додато и 0 уклоњено
  1. 15 0
      lib/python/pygrass/vector/__init__.py

+ 15 - 0
lib/python/pygrass/vector/__init__.py

@@ -203,6 +203,21 @@ class Vector(Info):
 #=============================================
 
 class VectorTopo(Vector):
+    """Vector class with the support of the GRASS topology.
+
+    Open a vector map using the *with statement*: ::
+
+        >>> with VectorTopo('schools') as schools:
+        ...     for school in schools[:3]:
+        ...         print school.attrs['NAMESHORT']
+        ...
+        SWIFT CREEK
+        BRIARCLIFF
+        FARMINGTON WOODS
+        >>> schools.is_open()
+        False
+
+    """
     def __init__(self, name, mapset=''):
         super(VectorTopo, self).__init__(name, mapset)
         self._topo_level = 2