[GRASS-SVN] r70518 - in grass/trunk: gui/wxpython/gui_core lib/python/script
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Feb 9 08:49:01 PST 2017
Author: martinl
Date: 2017-02-09 08:49:00 -0800 (Thu, 09 Feb 2017)
New Revision: 70518
Modified:
grass/trunk/gui/wxpython/gui_core/forms.py
grass/trunk/lib/python/script/task.py
Log:
GUI dialog: fix guidependency for maps/columns (see eg. v.what.vect query_map -> query_column)
Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py 2017-02-09 16:14:51 UTC (rev 70517)
+++ grass/trunk/gui/wxpython/gui_core/forms.py 2017-02-09 16:49:00 UTC (rev 70518)
@@ -317,12 +317,15 @@
elif name == 'ColumnSelect':
if map:
- if map in cparams:
- if not cparams[map]['dbInfo']:
- cparams[map]['dbInfo'] = gselect.VectorDBInfo(map)
- self.data[win.GetParent().InsertColumns] = {
- 'vector': map, 'layer': layer,
- 'dbInfo': cparams[map]['dbInfo']}
+ if map not in cparams:
+ cparams[map] = {'dbInfo': None,
+ 'layers': None, }
+
+ if not cparams[map]['dbInfo']:
+ cparams[map]['dbInfo'] = gselect.VectorDBInfo(map)
+ self.data[win.GetParent().InsertColumns] = {
+ 'vector': map, 'layer': layer,
+ 'dbInfo': cparams[map]['dbInfo']}
else: # table
if driver and db:
self.data[win.GetParent().InsertTableColumns] = {
Modified: grass/trunk/lib/python/script/task.py
===================================================================
--- grass/trunk/lib/python/script/task.py 2017-02-09 16:14:51 UTC (rev 70517)
+++ grass/trunk/lib/python/script/task.py 2017-02-09 16:49:00 UTC (rev 70518)
@@ -155,22 +155,19 @@
:param str element: element name
:param bool raiseError: True for raise on error
"""
- try:
- for p in self.params:
- val = p[element]
- if val is None:
- continue
- if isinstance(val, (list, tuple)):
- if value in val:
- return p
- elif isinstance(val, (bytes, unicode)):
- if p[element][:len(value)] == value:
- return p
- else:
- if p[element] == value:
- return p
- except KeyError:
- pass
+ for p in self.params:
+ val = p.get(element, None)
+ if val is None:
+ continue
+ if isinstance(val, (list, tuple)):
+ if value in val:
+ return p
+ elif isinstance(val, (bytes, unicode)):
+ if p[element][:len(value)] == value:
+ return p
+ else:
+ if p[element] == value:
+ return p
if raiseError:
raise ValueError(_("Parameter element '%(element)s' not found: '%(value)s'") % \
More information about the grass-commit
mailing list