Bug#759056: dicompyler: Please update to use wxpython3.0
Hi Olly, I have updated Vcs-Svn: svn://anonscm.debian.org/debian-med/trunk/packages/dicompyler/trunk/ a lot (also with help of Debian Python) but I think I'm stalled again with an WX3.0 issue. If I build the package as in SVN and run dicompyler I get a window telling me: XRC error: 229: invalid column index 7: must be less than 4 The detailed log says: 12:12:27: XRC error: 90: too many children in grid sizer: 12 3 x 1 (consider omitting the number of rows or columns) 12:12:27: XRC error: 90: unexpected item in sizer 12:12:27: XRC error: 229: invalid column index 5: must be less than 4 12:12:27: XRC error: 229: invalid column index 7: must be less than 4 Here is the full output of the xterm from where I called dicompyler: $ dicompyler ERROR: Unhandled exception: Traceback (most recent call last): File /usr/bin/dicompyler, line 9, in module load_entry_point('dicompyler==0.4.2', 'console_scripts', 'dicompyler')() File /usr/share/dicompyler/dicompyler/main.py, line 946, in start app = dicompyler(0) File /usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py, line 8631, in __init__ self._BootstrapApp() File /usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py, line 8196, in _BootstrapApp return _core_.PyApp__BootstrapApp(*args, **kwargs) File /usr/share/dicompyler/dicompyler/main.py, line 938, in OnInit dicompylerFrame = MainFrame(None, -1, dicompyler, self.res) File /usr/share/dicompyler/dicompyler/main.py, line 235, in __init__ parent = None, appname = 'dicompyler', name = 'Options') File /usr/share/dicompyler/dicompyler/preferences.py, line 35, in __init__ pub.subscribe(self.SetPreferenceTemplate, 'preferences.updated.template') TypeError: unbound method subscribe() must be called with Publisher instance as first argument (got instancemethod instance instead) Error in sys.excepthook: Traceback (most recent call last): File /usr/share/dicompyler/dicompyler/main.py, line 45, in LogExcepthook pub.sendMessage('logging.exception', text) TypeError: unbound method sendMessage() must be called with Publisher instance as first argument (got str instance instead) Original exception was: Traceback (most recent call last): File /usr/bin/dicompyler, line 9, in module load_entry_point('dicompyler==0.4.2', 'console_scripts', 'dicompyler')() File /usr/share/dicompyler/dicompyler/main.py, line 946, in start app = dicompyler(0) File /usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py, line 8631, in __init__ self._BootstrapApp() File /usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py, line 8196, in _BootstrapApp return _core_.PyApp__BootstrapApp(*args, **kwargs) File /usr/share/dicompyler/dicompyler/main.py, line 938, in OnInit dicompylerFrame = MainFrame(None, -1, dicompyler, self.res) File /usr/share/dicompyler/dicompyler/main.py, line 235, in __init__ parent = None, appname = 'dicompyler', name = 'Options') File /usr/share/dicompyler/dicompyler/preferences.py, line 35, in __init__ pub.subscribe(self.SetPreferenceTemplate, 'preferences.updated.template') TypeError: unbound method subscribe() must be called with Publisher instance as first argument (got instancemethod instance instead) ERROR: Unhandled exception: Traceback (most recent call last): File /usr/share/dicompyler/dicompyler/preferences.py, line 340, in OnClose pub.sendMessage('preferences.updated.values', self.values) TypeError: unbound method sendMessage() must be called with Publisher instance as first argument (got str instance instead) Error in sys.excepthook: Traceback (most recent call last): File /usr/share/dicompyler/dicompyler/main.py, line 45, in LogExcepthook pub.sendMessage('logging.exception', text) TypeError: unbound method sendMessage() must be called with Publisher instance as first argument (got str instance instead) Original exception was: Traceback (most recent call last): File /usr/share/dicompyler/dicompyler/preferences.py, line 340, in OnClose pub.sendMessage('preferences.updated.values', self.values) TypeError: unbound method sendMessage() must be called with Publisher instance as first argument (got str instance instead) Segmentation fault Any idea how to fix this? I have no idea whether this is connected to the patch[1] that was inspired by your suggestion[2]. If not you might like to adapt your script to include the changes I did in [1]. Could you possibly give some advise what might be wrong? Thanks a lot for your help Andreas. [1] http://anonscm.debian.org/viewvc/debian-med/trunk/packages/dicompyler/trunk/debian/patches/wxpy30-more.patch?revision=17981view=markup [2] http://sources.debian.net/src/bitpim/1.0.7%2Bdfsg1-4/debian/ -- http://fam-tille.de -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#759056: dicompyler: Please update to use wxpython3.0
On Thu, Sep 11, 2014 at 12:14:50PM +0200, Andreas Tille wrote: 12:12:27: XRC error: 90: too many children in grid sizer: 12 3 x 1 (consider omitting the number of rows or columns) 12:12:27: XRC error: 90: unexpected item in sizer 12:12:27: XRC error: 229: invalid column index 5: must be less than 4 12:12:27: XRC error: 229: invalid column index 7: must be less than 4 The first number is the line number in the XRC file (unhelpfully it doesn't say which, but a quick grep reveals it must be dicompyler/resources/main.xrc in both cases. First error is that the sizer is given 3 columns and 1 row and 12 items to add. I just omitted specifying the number of rows as it suggested, which seems more robust to further items being added. The second is that growable columns are set as 1,3,5,7 in a sizer with 4 columns. I've no idea what's intended, or how wx2.8 fixes up the mismatch, but raised that to 8 columns (so 7 8). If that changes the layout dropping 5 and 7 from the list would also make the error go away. Patch for that attached (but untested, as the pubsub stuff means I can't actually run the application). $ dicompyler ERROR: Unhandled exception: Traceback (most recent call last): File /usr/bin/dicompyler, line 9, in module load_entry_point('dicompyler==0.4.2', 'console_scripts', 'dicompyler')() File /usr/share/dicompyler/dicompyler/main.py, line 946, in start app = dicompyler(0) File /usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py, line 8631, in __init__ self._BootstrapApp() File /usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py, line 8196, in _BootstrapApp return _core_.PyApp__BootstrapApp(*args, **kwargs) File /usr/share/dicompyler/dicompyler/main.py, line 938, in OnInit dicompylerFrame = MainFrame(None, -1, dicompyler, self.res) File /usr/share/dicompyler/dicompyler/main.py, line 235, in __init__ parent = None, appname = 'dicompyler', name = 'Options') File /usr/share/dicompyler/dicompyler/preferences.py, line 35, in __init__ pub.subscribe(self.SetPreferenceTemplate, 'preferences.updated.template') TypeError: unbound method subscribe() must be called with Publisher instance as first argument (got instancemethod instance instead) Error in sys.excepthook: Traceback (most recent call last): File /usr/share/dicompyler/dicompyler/main.py, line 45, in LogExcepthook pub.sendMessage('logging.exception', text) TypeError: unbound method sendMessage() must be called with Publisher instance as first argument (got str instance instead) It looks like you need to pass a Publisher() object not a string as the first parameter there. I don't have time to look into that right now though. Cheers, Olly Description: Fix XRC errors reported by wxPython 3.0 Author: Olly Betts o...@survex.com Bug-Debian: https://bugs.debian.org/759056 Forwarded: no Last-Update: 2014-09-11 --- dicompyler-0.4.2.orig/dicompyler/resources/main.xrc +++ dicompyler-0.4.2/dicompyler/resources/main.xrc @@ -154,7 +154,6 @@ /object /object cols3/cols - rows1/rows vgap5/vgap hgap5/hgap growablecols1/growablecols @@ -222,7 +221,7 @@ option1/option flagwxALL|wxEXPAND|wxALIGN_CENTRE/flag /object - cols4/cols + cols8/cols rows2/rows vgap5/vgap hgap5/hgap
Bug#759056: dicompyler: Please update to use wxpython3.0
Looking at the bitpim pubsub changes (patch attached), I think you want to update from: from wx.lib.pubsub import Publisher as pub to this instead: import wx.lib.pubsub.setuparg1 import wx.lib.pubsub.core pub = wx.lib.pubsub.core.Publisher() I'm not sure if it should be the same pub instance in all the modules or not though. Updated version of wxpy30-more.patch attached too - with this the package builds and starts up OK (it failed to start up for me before them). Not sure how easy this is to automate in the script - I'd think there's probably a fair bit of variation in the import. Cheers, Olly diff -ruN bitpim-old/src/pubsub.py bitpim-new/src/pubsub.py --- bitpim-old/src/pubsub.py 2009-11-05 23:17:29.0 -0300 +++ bitpim-new/src/pubsub.py 2014-09-11 21:00:32.0 -0300 @@ -21,7 +21,8 @@ deleted. -from wx.lib.pubsub import Publisher +import wx.lib.pubsub.setuparg1 +from wx.lib.pubsub.core import Publisher ### @@ -69,11 +70,13 @@ media_old_name='old_name' media_new_name='new_name' +my_publisher = Publisher() + def subscribe(listener, topic): -Publisher.subscribe(listener, topic) +my_publisher.subscribe(listener, topic) def unsubscribe(listener): -Publisher.unsubscribe(listener) +my_publisher.unsubscribe(listener) def publish(topic, data=None): -Publisher.sendMessage(topic, data) +my_publisher.sendMessage(topic, data) Author: Andreas Tille ti...@debian.org Last-Update: Sat, 06 Sep 2014 15:57:29 +0200 Bug-Debian: http://bugs.debian.org/759056 Description: Further patches not applied by wx-migration-tool from http://anonscm.debian.org/cgit/collab-maint/wx-migration-tools.git --- a/dicompyler/baseplugins/anonymize.py +++ b/dicompyler/baseplugins/anonymize.py @@ -10,7 +10,9 @@ import wx from wx.xrc import XmlResource, XRCCTRL, XRCID -from wx.lib.pubsub import Publisher as pub +import wx.lib.pubsub.setuparg1 +import wx.lib.pubsub.core +pub = wx.lib.pubsub.core.Publisher() import os, threading from dicompyler import guiutil, util --- a/dicompyler/baseplugins/treeview.py +++ b/dicompyler/baseplugins/treeview.py @@ -13,7 +13,9 @@ logger = logging.getLogger('dicompyler.t import threading, Queue import wx from wx.xrc import XmlResource, XRCCTRL, XRCID -from wx.lib.pubsub import Publisher as pub +import wx.lib.pubsub.setuparg1 +import wx.lib.pubsub.core +pub = wx.lib.pubsub.core.Publisher() from wx.gizmos import TreeListCtrl as tlc from dicompyler import guiutil, util import dicom --- a/dicompyler/plugin.py +++ b/dicompyler/plugin.py @@ -12,7 +12,9 @@ logger = logging.getLogger('dicompyler.p import imp, os import wx from wx.xrc import * -from wx.lib.pubsub import Publisher as pub +import wx.lib.pubsub.setuparg1 +import wx.lib.pubsub.core +pub = wx.lib.pubsub.core.Publisher() from dicompyler import guiutil, util def import_plugins(userpath=None): --- a/dicompyler/baseplugins/quickopen.py +++ b/dicompyler/baseplugins/quickopen.py @@ -11,7 +11,9 @@ import logging logger = logging.getLogger('dicompyler.quickimport') import wx -from wx.lib.pubsub import Publisher as pub +import wx.lib.pubsub.setuparg1 +import wx.lib.pubsub.core +pub = wx.lib.pubsub.core.Publisher() from dicompyler import dicomparser, util import dicom --- a/dicompyler/baseplugins/2dview.py +++ b/dicompyler/baseplugins/2dview.py @@ -10,7 +10,9 @@ import wx from wx.xrc import XmlResource, XRCCTRL, XRCID -from wx.lib.pubsub import Publisher as pub +import wx.lib.pubsub.setuparg1 +import wx.lib.pubsub.core +pub = wx.lib.pubsub.core.Publisher() from matplotlib import _cntr as cntr from matplotlib import __version__ as mplversion import numpy as np --- a/dicompyler/baseplugins/dvh.py +++ b/dicompyler/baseplugins/dvh.py @@ -12,7 +12,9 @@ import wx from wx.xrc import XmlResource, XRCCTRL, XRCID -from wx.lib.pubsub import Publisher as pub +import wx.lib.pubsub.setuparg1 +import wx.lib.pubsub.core +pub = wx.lib.pubsub.core.Publisher() from dicompyler import guiutil, util from dicompyler import dvhdata, guidvh from dicompyler import wxmpl --- a/dicompyler/dicomgui.py +++ b/dicompyler/dicomgui.py @@ -15,7 +15,9 @@ logger = logging.getLogger('dicompyler.d import hashlib, os, threading import wx from wx.xrc import * -from wx.lib.pubsub import Publisher as pub +import wx.lib.pubsub.setuparg1 +import wx.lib.pubsub.core +pub = wx.lib.pubsub.core.Publisher() import numpy as np from dicompyler import dicomparser, dvhdoses, guiutil, util --- a/dicompyler/guiutil.py +++ b/dicompyler/guiutil.py @@ -10,7 +10,9 @@ import util import wx from wx.xrc import XmlResource, XRCCTRL, XRCID -from wx.lib.pubsub import Publisher as pub +import wx.lib.pubsub.setuparg1 +import wx.lib.pubsub.core +pub = wx.lib.pubsub.core.Publisher() def IsMSWindows(): Are we running on Windows? --- a/dicompyler/main.py +++ b/dicompyler/main.py @@ -20,7 +20,9 @@ from wx.xrc import * import wx.lib.dialogs, webbrowser # Uncomment line to setup pubsub for frozen targets on wxPython
Bug#759056: dicompyler: Please update to use wxpython3.0
Hi Olly, On Sun, Aug 24, 2014 at 12:19:35PM +1200, Olly Betts wrote: Source: dicompyler Version: 0.4.1-1-2 Severity: important Tags: sid jessie User: freewx-ma...@lists.alioth.debian.org Usertags: wxpy3.0 Control: block 755757 by -1 ... http://anonscm.debian.org/cgit/collab-maint/wx-migration-tools.git ... I used the script I found there but if I run the patched application (see Vcs-Svn: svn://anonscm.debian.org/debian-med/trunk/packages/dicompyler/trunk/ ) I get: $ dicompyler Traceback (most recent call last): File /usr/lib/python2.7/runpy.py, line 162, in _run_module_as_main __main__, fname, loader, pkg_name) File /usr/lib/python2.7/runpy.py, line 72, in _run_code exec code in run_globals File /usr/share/dicompyler/main.py, line 23, in module from wx.lib.pubsub import Publisher as pub ImportError: cannot import name Publisher swig/python detected a memory leak of type 'wxPyXmlSubclassFactory *', no destructor found. Any hint how to fix this? Kind regards Andreas. -- http://fam-tille.de -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#759056: dicompyler: Please update to use wxpython3.0
Hi Andreas, On Thu, Sep 04, 2014 at 12:26:39AM +0200, Andreas Tille wrote: On Sun, Aug 24, 2014 at 12:19:35PM +1200, Olly Betts wrote: Source: dicompyler Version: 0.4.1-1-2 Severity: important Tags: sid jessie User: freewx-ma...@lists.alioth.debian.org Usertags: wxpy3.0 Control: block 755757 by -1 ... http://anonscm.debian.org/cgit/collab-maint/wx-migration-tools.git ... I used the script I found there but if I run the patched application (see Vcs-Svn: svn://anonscm.debian.org/debian-med/trunk/packages/dicompyler/trunk/ ) I get: $ dicompyler Traceback (most recent call last): File /usr/lib/python2.7/runpy.py, line 162, in _run_module_as_main __main__, fname, loader, pkg_name) File /usr/lib/python2.7/runpy.py, line 72, in _run_code exec code in run_globals File /usr/share/dicompyler/main.py, line 23, in module from wx.lib.pubsub import Publisher as pub ImportError: cannot import name Publisher swig/python detected a memory leak of type 'wxPyXmlSubclassFactory *', no destructor found. Any hint how to fix this? It seems the pubsub stuff (which isn't in the C++ API but wxPython bundles) changed API quite a bit. I hit that ImportError when I tried to rebuild bitpim, but ucko fixed it before I looked into what was going on: Use a less ancient pubsub interface. https://packages.qa.debian.org/b/bitpim/news/20140829T230338Z.html It looks like bitpim's patches aren't split out, but a debdiff between -3 and -4 would likely be instructive: http://sources.debian.net/src/bitpim/1.0.7%2Bdfsg1-4/debian/ Hope that's a helpful pointer. Cheers, Olly -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org