[wxPython] problem with wxgrid/wxpygridtablebase

We have a script which creates a wxGrid, creates a wxPyGridTableBase and
then associates the tablebase with the grid. The code shown below was
working without errors on wxPython 2.3.2.1 but having upgraded to 2.3.3.1 we
are now encountering an error.
The table class we use is; class CustomDataTable(wxPyGridTableBase):
def __init__(self,colheadings,data,coltypes,log):
wxPyGridTableBase.__init__(self)
self.colLabels=colheadings
self.dataTypes=coltypes
self.dataÚta

Examples of data, coltypes and log would be;
col heads=['loc_name', 'K2', 'Grp', 'K3', 'customer Name', 'Terr', 'SKUs',
'Fifo Value', 'COS 12mth', 'Stk Turn']
data=[['Cust', 21, ", '0', ", ", 1921, '179028.06',
'1525994.13', '8.52'], ['Cust', 21, 'Accno', 'Accno', 'cust',
'210', 15889, '269398.99', '725436.75', '2.69'],
['Totals', ", ", ", ", ", 17810, '448427.05', '2251430.87', '5.02']]
col types=['wxGRID_VALUE_STRING', 'wxGRID_VALUE_FLOAT',
'wxGRID_VALUE_STRING', 'wxGRID_VALUE_STRING', 'wxGRID_VALUE_STRING',
'wxGRID_VALUE_STRING', 'wxGRID_VALUE_FLOAT', 'wxGRID_VALUE_FLOAT',
'wxGRID_VALUE_FLOAT', 'wxGRID_VALUE_FLOAT']
log=<C wxMDIChildFrame instance at _1f89010_wxMDIChildFrame_p>
The class is called by;
self.tableptr.append(CustomDataTable(colheadings,data,coltypes,log))
The appropriate grid is then populated by;
self.gridptr[self.gridcnt].SetTable(self.tableptr[self.gridcnt],true)
It is during the grid population that the error occurs, once for each cell.
The error window shows;
Debug c:\projects\wx\src\generic\grid.cpp(8984): assert "wxFalse" failed:
Unknown data type name Do you want to stop the program?
You can choose [Cancel] to suppress further warnings.

Any ideas what could be causing this?

Regards

Finbarr

Finbarr O'Keeffe wrote:

We have a script which creates a wxGrid, creates a wxPyGridTableBase and
then associates the tablebase with the grid. The code shown below was
working without errors on wxPython 2.3.2.1 but having upgraded to 2.3.3.1 we
are now encountering an error.
The table class we use is; class CustomDataTable(wxPyGridTableBase):
def __init__(self,colheadings,data,coltypes,log):
wxPyGridTableBase.__init__(self)
self.colLabels=colheadings
self.dataTypes=coltypes
self.dataÚta

Examples of data, coltypes and log would be;
col heads=['loc_name', 'K2', 'Grp', 'K3', 'customer Name', 'Terr', 'SKUs',
'Fifo Value', 'COS 12mth', 'Stk Turn']
data=[['Cust', 21, ", '0', ", ", 1921, '179028.06',
'1525994.13', '8.52'], ['Cust', 21, 'Accno', 'Accno', 'cust',
'210', 15889, '269398.99', '725436.75', '2.69'],
['Totals', ", ", ", ", ", 17810, '448427.05', '2251430.87', '5.02']]
col types=['wxGRID_VALUE_STRING', 'wxGRID_VALUE_FLOAT',
'wxGRID_VALUE_STRING', 'wxGRID_VALUE_STRING', 'wxGRID_VALUE_STRING',
'wxGRID_VALUE_STRING', 'wxGRID_VALUE_FLOAT', 'wxGRID_VALUE_FLOAT',
'wxGRID_VALUE_FLOAT', 'wxGRID_VALUE_FLOAT']
log=<C wxMDIChildFrame instance at _1f89010_wxMDIChildFrame_p>
The class is called by;
self.tableptr.append(CustomDataTable(colheadings,data,coltypes,log))
The appropriate grid is then populated by;
self.gridptr[self.gridcnt].SetTable(self.tableptr[self.gridcnt],true)
It is during the grid population that the error occurs, once for each cell.
The error window shows;
Debug c:\projects\wx\src\generic\grid.cpp(8984): assert "wxFalse" failed:
Unknown data type name Do you want to stop the program?
You can choose [Cancel] to suppress further warnings.

Any ideas what could be causing this?

No, but if you send a small, but complete example I'll take a look at it.

P.S. I am very much like Python. I can't read python code (or emails) that doesn't have proper whitespace! :wink:

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!