Phoenix - demo and DataViewModel

Hi Robin,

I have locally a branch on which I merged all the PR's which I based on metallicow's, I use this branch for my testing. It contains a few miscellaneous commits with changes needed to get main.py and the individual demos I am testing to run in py2 and py3.

I'll do one PR on this one later today, let me know if this is usable for you or if it needs to be broken down.

I am getting this exception with the above.

File "H:\devProjectsT\Phoenix\demo\DVC_DataViewModel.py", line 352, in <module>
   run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
File "H:\devProjectsT\Phoenix\demo\run.py", line 161, in main
   app = RunDemoApp(name, module, useShell)
File "H:\devProjectsT\Phoenix\demo\run.py", line 51, in __init__
   wx.App.__init__(self, redirect=False)
File "c:\Python33\Lib\site-packages\wx-3.0.0-msw-phoenix\wx\core.py", line 1844, in __init__
   self._BootstrapApp()
File "H:\devProjectsT\Phoenix\demo\run.py", line 82, in OnInit
   win = self.demoModule.runTest(frame, frame, Log())
File "H:\devProjectsT\Phoenix\demo\DVC_DataViewModel.py", line 329, in runTest
   win = TestPanel(nb, log, data=data)
File "H:\devProjectsT\Phoenix\demo\DVC_DataViewModel.py", line 248, in __init__
   self.model = MyTreeListModel(data, log)
File "H:\devProjectsT\Phoenix\demo\DVC_DataViewModel.py", line 82, in __init__
   self.objmapper.UseWeakRefs(True)

builtins.AttributeError: 'MyTreeListModel' object has no attribute 'objmapper'

Werner wrote:

Hi Robin,

I have locally a branch on which I merged all the PR's which I based on
metallicow's, I use this branch for my testing. It contains a few
miscellaneous commits with changes needed to get main.py and the
individual demos I am testing to run in py2 and py3.

I'll do one PR on this one later today, let me know if this is usable
for you or if it needs to be broken down.

I am getting this exception with the above.

File "H:\devProjectsT\Phoenix\demo\DVC_DataViewModel.py", line 352, in
<module>
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
File "H:\devProjectsT\Phoenix\demo\run.py", line 161, in main
app = RunDemoApp(name, module, useShell)
File "H:\devProjectsT\Phoenix\demo\run.py", line 51, in __init__
wx.App.__init__(self, redirect=False)
File "c:\Python33\Lib\site-packages\wx-3.0.0-msw-phoenix\wx\core.py",
line 1844, in __init__
self._BootstrapApp()
File "H:\devProjectsT\Phoenix\demo\run.py", line 82, in OnInit
win = self.demoModule.runTest(frame, frame, Log())
File "H:\devProjectsT\Phoenix\demo\DVC_DataViewModel.py", line 329, in
runTest
win = TestPanel(nb, log, data=data)
File "H:\devProjectsT\Phoenix\demo\DVC_DataViewModel.py", line 248, in
__init__
self.model = MyTreeListModel(data, log)
File "H:\devProjectsT\Phoenix\demo\DVC_DataViewModel.py", line 82, in
__init__
self.objmapper.UseWeakRefs(True)

builtins.AttributeError: 'MyTreeListModel' object has no attribute
'objmapper'

I changed things around a bit there. Instead of the objmapper being an attribute of the class, it is now a one of the base classes (as a mixin) of PyDataViewModel. See:

  http://wxpython.org/Phoenix/docs/html/dataview.DataViewItemObjectMapper.html

  http://wxpython.org/Phoenix/docs/html/dataview.PyDataViewModel.html

So you should be able to replace the self.objmapper with just self everywhere. There is also some working standalone DVC samples in samples/dataview that you can use as a guide for updating the samples in the demo.

···

--
Robin Dunn
Software Craftsman

Hi,

Werner wrote:

...

I changed things around a bit there. Instead of the objmapper being an attribute of the class, it is now a one of the base classes (as a mixin) of PyDataViewModel. See:

    http://wxpython.org/Phoenix/docs/html/dataview.DataViewItemObjectMapper.html

    http://wxpython.org/Phoenix/docs/html/dataview.PyDataViewModel.html

So you should be able to replace the self.objmapper with just self everywhere. There is also some working standalone DVC samples in samples/dataview that you can use as a guide for updating the samples in the demo.

I am sure that worked, but now with 75722 both 'demo.DVC_DataViewModel' and 'sample.DataViewModel' just crash without exception, IndexListModel is working fine.

Werner

···

On 24/01/2014 06:11, Robin Dunn wrote:

Werner wrote:

I am sure that worked, but now with 75722 both 'demo.DVC_DataViewModel'
and 'sample.DataViewModel' just crash without exception, IndexListModel
is working fine.

Just FYI, I've duplicated this and am working on tracking down the cause. It's complicated by the fact that it doesn't happen in the debug builds, only in the release builds which currently are not instrumented for tracing in the debugger.

I thought I had it fixed but it turned out that it was a different bug in dataview that only happens on OSX, an infinite recursion when calling item.SetSortable. I think I have that one fixed, although it requires a change in wx that I'm not 100% sure is correct, so I haven't committed it yet. I'll need to discuss it on wx-dev first.

···

--
Robin Dunn
Software Craftsman