wxWidgets issue

Anthony Lenton antoniolenton at gmail.com
Tue Jun 3 05:28:03 CEST 2008


Hello list,
On my machine you can't bring up the Classification Generation Dialog
without getting a traceback.
This is the traceback:

Traceback (most recent call last):
  File "/home/anthony/svn/thuban/trunk/thuban/Thuban/UI/classifier.py",
line 1057, in _OnGenClass
    internal_from_wxstring(self.fields.GetString(self.__cur_field)))
  File "/home/anthony/svn/thuban/trunk/thuban/Thuban/UI/classgen.py",
line 111, in __init__
    obj = clazz(self, self.layer, self.fieldName, self.fieldType)
  File "/home/anthony/svn/thuban/trunk/thuban/Thuban/UI/classgen.py",
line 412, in __init__
    self.numGroupsCtrl.SetRange(1, sys.maxint)
  File "/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py",
line 2265, in SetRange
    return _controls_.SpinCtrl_SetRange(*args, **kwargs)
OverflowError: in method 'SpinCtrl_SetRange', expected argument 3 of type 'int'

I suspect this is because my python is aware of the 64-bit hardware
it's running on, but wx has been compiled for 32 bits.  I don't know
if there's a way to ask wx which is the maximum integer it'll accept
as an argument, but this fixes it anyway:

Index: Thuban/UI/classgen.py
===================================================================
--- Thuban/UI/classgen.py	(revisión: 2842)
+++ Thuban/UI/classgen.py	(copia de trabajo)
@@ -409,7 +409,7 @@
         self.numGroupsChanging = False
         self.steppingChanging = False

-        self.numGroupsCtrl.SetRange(1, sys.maxint)
+        self.numGroupsCtrl.SetRange(1, 2**31-1)

         self.numGroupsCtrl.SetValue(1)
         self.stepCtrl.SetValue("1")
@@ -832,7 +832,7 @@
                                         _("Retrieve from Table"))

         self.spin_numClasses = wx.SpinCtrl(self, -1, style=wx.TE_RIGHT)
-        self.spin_numClasses.SetRange(2, sys.maxint)
+        self.spin_numClasses.SetRange(2, 2**31-1)
         self.spin_numClasses.SetValue(2)


-- 
Anthony Lenton
Except - The good guys in software development
http://except.com.ar




More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)