[GRASS-SVN] r38607 - grass-addons/vector/v.krige

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 3 15:49:42 EDT 2009


Author: aghisla
Date: 2009-08-03 15:49:42 -0400 (Mon, 03 Aug 2009)
New Revision: 38607

Modified:
   grass-addons/vector/v.krige/v.krige.py
Log:
replaced sys.maxint with 1e6, as is in dbm.py, to avoid 64bit crashes. thanks to Bob Moskovitz for testing.

Modified: grass-addons/vector/v.krige/v.krige.py
===================================================================
--- grass-addons/vector/v.krige/v.krige.py	2009-08-03 18:01:08 UTC (rev 38606)
+++ grass-addons/vector/v.krige/v.krige.py	2009-08-03 19:49:42 UTC (rev 38607)
@@ -140,6 +140,9 @@
     robjects.r.library("spgrass6", verbose=False)
 except:
     sys.exit(_("No gstat neither geoR package installed. Install one of them (gstat preferably) via R installer."))
+    
+# globals
+maxint = 1e6 # instead of sys.maxint, not working with SpinCtrl on 64bit [reported by Bob Moskovitz]
 
 #classes in alphabetical order. methods in logical order :)
 
@@ -451,7 +454,7 @@
         self.ParametersList = ["Sill", "Nugget", "Range"]
         for n in self.ParametersList:
             setattr(self, n+"Text", (wx.StaticText(self, id= wx.ID_ANY, label = _(n))))
-            setattr(self, n+"Ctrl", (wx.SpinCtrl(self, id = wx.ID_ANY, max=sys.maxint)))
+            setattr(self, n+"Ctrl", (wx.SpinCtrl(self, id = wx.ID_ANY, max=maxint)))
             setattr(self, n+"CheckBox", wx.CheckBox(self,
                                                     id=self.ParametersList.index(n),
                                                     label=_("Use value")))
@@ -465,7 +468,7 @@
         
         # block kriging parameters. Size.
         BlockLabel = wx.StaticText(self, id= wx.ID_ANY, label = _("Block size:"))
-        self.BlockSpinBox = wx.SpinCtrl(self, id = wx.ID_ANY, min=1, max=sys.maxint)
+        self.BlockSpinBox = wx.SpinCtrl(self, id = wx.ID_ANY, min=1, max=maxint)
         self.BlockSpinBox.Enable(False) # default choice is Ordinary kriging
 
         self.ParametersSizer.Add(BlockLabel, flag= wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=3)



More information about the grass-commit mailing list