Donnal Walter <donnalcwalter@yahoo.com> writes:
> It is possible to get a zip version of the wx package?
> I can't get it using CVS because I'm behind a firewall.
It is only 1K. Simply place the attached __init__.py file in an
empty folder named 'wx' in your wxPython folder.
Thanks, Donnal. Here are a few details to consider.
That __init__.py will handle the main wx namespace, but not all the
other modules, such as calendars, gizmos, grid, help, etc. The wx
package that will be installed by wxPython 2.4.1 does handle all the
other modules. But if you aren't using any of those modules, you'll
be fine with just a wx directory and that __init__.py file (or,
preferably, the one below) on your Python Path.
Also the wx directory you create shouldn't be a subdirectory of
wxPython, it should simply be its own package, somewhere on your
Python Path, accessed using:
import wx
And, finally, the version of the code Donnal posted is not compatible
with Python 2.1. Here is the latest from the wxPython CVS repository:
"""wx package
Provides a way to drop the wx prefix from wxPython objects."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
__cvsid__ = "$Id: __init__.py,v 1.1.2.2 2003/04/30 14:19:17 PKO Exp $"
__revision__ = "$Revision: 1.1.2.2 $"[11:-2]
from wxPython import wx
import types
d_new = globals()
d_old = wx.__dict__
for old, obj in d_old.items():
if type(obj) is types.ModuleType or old.startswith('_'):
# Skip modules and private names.
continue
new = old
if old.startswith('EVT_'):
# Leave name unmodified; add to the new wx namespace.
d_new[new] = obj
elif old.startswith('wxEVT_'):
# Leave name unmodified; add to the new wx namespace.
d_new[new] = obj
else:
if old.startswith('wx'):
# Remove the 'wx' prefix.
new = old[2:]
# Add to the new wx package namespace.
d_new[new] = obj
del d_new
del d_old
del new
del obj
del old
del types
del wx
Let us know if you run into any problems.
···
--- "Echeverria_Rabi,_Cristián" <cecheverria@transelec.cl> wrote:
--
Patrick K. O'Brien
Orbtech http://www.orbtech.com/web/pobrien
-----------------------------------------------
"Your source for Python programming expertise."
-----------------------------------------------