Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#3844 closed enhancement (fixed)

Make Region importable from pygrass.gis

Reported by: pmav99 Owned by: grass-dev@…
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"

Change History (1)

comment:1 by martinl, 5 years ago

Resolution: fixed
Status: newclosed
Last edited 5 years ago by martinl (previous) (diff)
Note: See TracTickets for help on using tickets.