03 Jan 2004
Sat, 03 Jan 2004
Sam Ruby's WxPython Aggregator
I was trying out the python aggregator code tonight and ran into a little hickup:
Traceback (most recent call last): File "agg.py", line 89, in selectFeed if not self.list.GetColumn(0): self.list.InsertColumn(0, 'Title') File "/usr/lib/python2.2/site-packages/wxPython/controls2.py", line 645, in Ge tColumn val = controls2c.wxListCtrl_GetColumn(self, *_args, **_kwargs) wxPython.wxc.wxPyAssertionError: C++ assertion "wxAssertFailure" failed in /usr/ src/redhat/BUILD/wxPythonSrc-2.4.2.4/src/generic/listctrl.cpp(3834): invalid col umn index in GetColumn
I found that this could be eliminated by a slight patch to the code:
89,90c89,90 < if self.list.GetColumnCount() < 1 : self.list.InsertColumn(0, 'Title') < --- > if not self.list.GetColumn(0): self.list.InsertColumn(0, 'Title') >
Not sure whether this was due to python version, wx version, or what, but the fact that they asserted on GetColumn(0) seemed to suggest that this is not the right way to check for a null column list. I've never used wx before, so I'm really naive in this regard.
Thanks for the code. It works great and is easy to grok.
I tried to post this message to sam's comments, but apache generated a 500 internal server error when I hit the submit button and then I couldn't get any of the forms to work, so it becomes a blog entry.
Posted at: 01:04 | permalink