[GRASS-SVN] r38286 - grass-addons/vector/v.krige
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jul 6 09:23:08 EDT 2009
Author: martinl
Date: 2009-07-06 09:23:08 -0400 (Mon, 06 Jul 2009)
New Revision: 38286
Modified:
grass-addons/vector/v.krige/v.krige.py
Log:
don't crash if ModelFactor fails
Modified: grass-addons/vector/v.krige/v.krige.py
===================================================================
--- grass-addons/vector/v.krige/v.krige.py 2009-07-06 13:15:31 UTC (rev 38285)
+++ grass-addons/vector/v.krige/v.krige.py 2009-07-06 13:23:08 UTC (rev 38286)
@@ -292,9 +292,14 @@
""" Subclass of RBookPanel, with specific gstat options and kriging functions. """
def __init__(self, parent, *args, **kwargs):
RBookPanel.__init__(self, parent, *args, **kwargs)
+
+ try:
+ ModelFactor = robjects.r.vgm().r['long']
+ ModelList = robjects.r.levels(ModelFactor[0]) # no other way to let the Python pick it up..
+ except AttributeError, e:
+ print >> sys.stderr, 'Error: ' + str(e)
+ ModelList = []
- ModelFactor = robjects.r.vgm().r['long']
- ModelList = robjects.r.levels(ModelFactor[0]) # no other way to let the Python pick it up..
self.ParametersSizer.Insert(before=0, item=wx.StaticText(self, id= wx.ID_ANY, label = _("Variogram model")))
self.ModelChoicebox = wx.Choice(self, id=wx.ID_ANY, choices=ModelList)
self.ParametersSizer.Insert(before=1, item= self.ModelChoicebox)
More information about the grass-commit
mailing list