[GRASS-SVN] r56323 - grass/trunk/lib/python/pygrass/vector
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon May 20 04:16:24 PDT 2013
Author: zarch
Date: 2013-05-20 04:16:23 -0700 (Mon, 20 May 2013)
New Revision: 56323
Modified:
grass/trunk/lib/python/pygrass/vector/abstract.py
Log:
Fix Vector name attribute.
Modified: grass/trunk/lib/python/pygrass/vector/abstract.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/abstract.py 2013-05-20 09:46:17 UTC (rev 56322)
+++ grass/trunk/lib/python/pygrass/vector/abstract.py 2013-05-20 11:16:23 UTC (rev 56323)
@@ -102,10 +102,7 @@
def _get_name(self):
"""Private method to obtain the Vector name"""
- if self.exist() and self.is_open():
- return libvect.Vect_get_name(self.c_mapinfo)
- else:
- return self._name
+ return self._name
def _set_name(self, newname):
"""Private method to change the Vector name"""
@@ -257,7 +254,10 @@
def rename(self, newname):
"""Method to rename the Vector map"""
if self.exist():
- functions.rename(self.name, newname, 'vect')
+ if not self.is_open():
+ functions.rename(self.name, newname, 'vect')
+ else:
+ raise GrassError("The map is open, not able to renamed it.")
self._name = newname
def is_3D(self):
More information about the grass-commit
mailing list