[GRASS-SVN] r57453 - grass/trunk/gui/wxpython/vdigit
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Aug 13 14:48:39 PDT 2013
Author: martinl
Date: 2013-08-13 14:48:39 -0700 (Tue, 13 Aug 2013)
New Revision: 57453
Modified:
grass/trunk/gui/wxpython/vdigit/wxdigit.py
Log:
wxGUI/vdigit: fix deleting records when removing feature
Modified: grass/trunk/gui/wxpython/vdigit/wxdigit.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/wxdigit.py 2013-08-13 21:26:24 UTC (rev 57452)
+++ grass/trunk/gui/wxpython/vdigit/wxdigit.py 2013-08-13 21:48:39 UTC (rev 57453)
@@ -431,7 +431,7 @@
if not self._checkMap():
return -1
- # colect categories for delete if requested
+ # collect categories for deleting if requested
deleteRec = UserSettings.Get(group = 'vdigit', key = 'delRecord', subkey = 'enabled')
catDict = dict()
if deleteRec:
@@ -453,7 +453,7 @@
if nlines > 0:
if deleteRec:
- self._deleteRecords(cats)
+ self._deleteRecords(catDict)
self._addChangeset()
self.toolbar.EnableUndo()
@@ -476,7 +476,7 @@
return -1
Fi = poFi.contents
- if Fi.table not in cats.keys():
+ if Fi.number not in cats.keys():
continue
poDriver = db_start_driver(Fi.driver)
@@ -493,19 +493,19 @@
db_init_string(poStmt)
db_set_string(poStmt, "DELETE FROM %s WHERE" % Fi.table)
n_cats = 0
- for cat in cats[Fi.table]:
+ for cat in cats[Fi.number]:
if n_cats > 0:
db_append_string(poStmt, " or")
- db_append_string(poStmt, " %s = %d" % (Fi.key, cats))
+ db_append_string(poStmt, " %s = %d" % (Fi.key, cat))
n_cats += 1
-
+
if n_cats > 0 and \
db_execute_immediate(poDriver, poStmt) != DB_OK:
self._error.DbExecute(db_get_string(poStmt))
return -1
- db_close_shutdown_database(poDriver)
+ db_close_database_shutdown_driver(poDriver)
def DeleteSelectedAreas(self):
"""!Delete selected areas (centroid+boundaries)
More information about the grass-commit
mailing list