#3844 closed enhancement (fixed)
Make Region importable from pygrass.gis
Reported by: | pmav99 | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.8.0 |
Component: | PyGRASS | Version: | svn-trunk |
Keywords: | Cc: | ||
CPU: | Unspecified | Platform: | Unspecified |
Description
Currently, in order to import the Region
class you need to import it from pygrass.gis.region
. The following patch allows to import it from the pygrass.gis
package. This way, all gis objects can be imported/used from the same module. E.g.
import grass.pygrass.gis as ggis ggis.Region ggis.Location ggis.Mapset
The patch:
diff --git lib/python/pygrass/gis/__init__.py lib/python/pygrass/gis/__init__.py index 82e176bd..2e65e990 100644 --- lib/python/pygrass/gis/__init__.py +++ lib/python/pygrass/gis/__init__.py @@ -9,11 +9,11 @@ import shutil import ctypes as ct import fnmatch - import grass.lib.gis as libgis from grass.pygrass.errors import GrassError from grass.script.utils import encode, decode from grass.pygrass.utils import getenv +from grass.pygrass.gis.region import Region test_vector_name = "Gis_test_vector" test_raster_name = "Gis_test_raster"
Note:
See TracTickets
for help on using tickets.
Closed by https://github.com/OSGeo/grass/commit/e328eab9738f04d173dd89b88e52e7d8dc33f2fc