wx prefixes in third party libraries

Robin,

Item for consideration. I have noticed in a number of the third party libs
(i.e. wx.lib.*) that a lot of the stuff in there has a wx prefix, but of
course the renamer didn't change them.

I'm of many minds on this. (note: I'll use wxFloatBar in floatbar.py as an
example here)

1) Leaving the wx prefix (i.e. wxFloatBar) is inconsistent with the new wx
namespace.

2) However, wx.lib is actually the prefix here, so wx.lib.wxFloatBar is a
little less confusing

3) Renaming the components of these modules may be a bit arbitrary,
especially if contributed and maintained by a third party.

So I'm not sure what should be done. I'm leaning towards leave 'em where
they're at unless the original author decides to migrate it himself, and in
which case reverse renamers should be provided in the module (i.e.
wxFloatBar becomes FloatBar, but we have a line that aliases wxFloatBar to
FloatBar)

Jeff Grimmett wrote:

Robin,

Item for consideration. I have noticed in a number of the third party libs
(i.e. wx.lib.*) that a lot of the stuff in there has a wx prefix, but of
course the renamer didn't change them.

I'm of many minds on this. (note: I'll use wxFloatBar in floatbar.py as an
example here)

1) Leaving the wx prefix (i.e. wxFloatBar) is inconsistent with the new wx
namespace.

2) However, wx.lib is actually the prefix here, so wx.lib.wxFloatBar is a
little less confusing

3) Renaming the components of these modules may be a bit arbitrary,
especially if contributed and maintained by a third party.

The original plan was to rename all of them too, mainly for consistentcy. In fact, if you use the wx namespace in 2.4 then the lib modules are renamed there just like the core library. Any other opinions about it?

So I'm not sure what should be done. I'm leaning towards leave 'em where
they're at unless the original author decides to migrate it himself, and in
which case reverse renamers should be provided in the module (i.e.
wxFloatBar becomes FloatBar, but we have a line that aliases wxFloatBar to
FloatBar)

If they are done now then the reverse renamers woudl only have to be done when using the wxPython package, and there are already files in wxPython/lib that just need to be teaked a bit when the real modules are changed. For example in wxPython/lib/floatbar.py we have:

import wx.lib.floatbar

__doc__ = wx.lib.floatbar.__doc__

wxFloatBar = wx.lib.floatbar.wxFloatBar

So when wx/lib/floatbar.py is changed to drop the wx then the last line above needs tweaked to drop the wx and people still importing from wxPython.lib.floatbar won't have to change anything.

···

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

The original plan was to rename all of them too, mainly for
consistentcy. In fact, if you use the wx namespace in 2.4 then the lib
modules are renamed there just like the core library. Any other opinions
about it?

No, I like that too, and in fact thought that was the original plan, but
then thought maybe I had read too much into that and that the contributed
.lib.* files were an exception.

Do we need to physically rename the objects (classes, attributes, etc) in
the libraries (i.e. edit them) for this all to work? I think that's what my
question *really* is :slight_smile:

Jeff Grimmett wrote:

The original plan was to rename all of them too, mainly for
consistentcy. In fact, if you use the wx namespace in 2.4 then the lib
modules are renamed there just like the core library. Any other opinions
about it?

No, I like that too, and in fact thought that was the original plan, but
then thought maybe I had read too much into that and that the contributed
.lib.* files were an exception.

Do we need to physically rename the objects (classes, attributes, etc) in
the libraries (i.e. edit them) for this all to work?

Yes.

···

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

Robin Dunn wrote:

Do we need to physically rename the objects (classes, attributes, etc) in
the libraries (i.e. edit them) for this all to work?

Yes.

And also be sure to update the coresponding module in wxPython/lib.

···

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

From: Robin Dunn [mailto:robin@alldunn.com]

And also be sure to update the coresponding module in wxPython/lib.

That's probably why if fell over last time I tried it.