I've submitted the patches to trac (see the forwarded message for more info):
py3k support for wx.lib.masked (phoenix)
http://trac.wxwidgets.org/ticket/15163
py3k support for wx.lib.mixins.listctrl.ColumnSorterMixin (phoenix)
http://trac.wxwidgets.org/ticket/15164
Also, let me know if you think convenient to update the phoenix wiki
pages to reflect the recomendations in the thread (for example, adding
the code snippets about six that sent Robin)
Best regards,
Mariano Reingart
http://www.sistemasagiles.com.ar
···
---------- Forwarded message ----------
From: Mariano Reingart <reingart@gmail.com>
Date: Wed, Apr 24, 2013 at 2:25 PM
Subject: Re: [wxPython-users] porting gui2py (pythoncard fork) to
py3k+phoenix: it works! but some issues found
To: wxpython-users@googlegroups.com
On Tue, Apr 23, 2013 at 10:53 PM, Robin Dunn <robin@alldunn.com> wrote:
Mariano Reingart wrote:
Dear:
Thank you for your excellent work in py3k + phoenix, just using 2to3
and minor fixes I almost could get my code working from wx2.8 to
wx2.9.5.81 (py2.5 to py3.2) in an initial attempt.I found the following issues:
wx.gizmos.TreeListCtrl seems not to be there too, what should be used
instead?There is a wx.adv.TreeListCtrl that is similar. It is derived from the
DataViewCtrl and so it has many of the same capabilities. If you need
something more flexible, with a pluggable data model, renderers, etc. then
you can also use DataViewCtrl directly and get hierarchical and/or tabular
data views.No module named wx.propgrid, will it be supported?
Eventually.
maskededit seems to be unported (uses types module, old string
manipulation and some py2 constructs), are you planing to maintain it
in phoenix?Yep. With lots of help from the community. <hint!> See
ProjectPhoenix/LibraryMigration - wxPyWikiI could fix some minor issues in maskedit.py and numctrl.py (attached
diff) but I'm not sure about several needed changes, for example:in numctrl.py I get the following exception about Validator_IsSilent,
how should it be fixed?File "/home/reingart/gui2py/3/wx/lib/masked/numctrl.py", line 971,
in _disallowValue
if not wx.Validator_IsSilent():
AttributeError: 'module' object has no attribute 'Validator_IsSilent'See the section in the Migration Guide about static methods.
wxPython Project Phoenix Migration Guide — wxPython Phoenix 4.2.3a1 documentationIn listctrl (and in maskededit too), its checks with type to look for
a string / unicode, how this check should be made in py3k + phoenix?File "/home/reingart/gui2py/3/wx/lib/mixins/listctrl.py", line 157,
in __ColumnSorter
if type(item1) == unicode and type(item2) == unicode:We're using a copy of the six module to help make code be both Py2.7 and Py3
compatible. For example, for just testing if something is a string type
then you could do:import wx.lib.six as six
if isinstance(item1, six.string_types):
...But in this specific case I think I would just add another layer of
conditionals to the statement checking for the Python version, something
like:if not six.PY3:
current code
else:
new code
Thanks very much!
I was able to fix all the blocking issues (masked, numctrl, listctrl
mixin), so gui2py now runs without issues on phoenix (still with some
minor deprecation warning, but working fine)
I'll move the discussion to wxpython-dev with the proposed patch, and,
if accepted, clarification of the wiki with the recommendations in
this thread.
Best regards
Mariano Reingart
http://www.sistemasagiles.com.ar