This commit was manufactured by cvs2svn to create tag 'WX_2_4_1'.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/WX_2_4_1@21086 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
41
wxPython/wx/__init__.py
Normal file
41
wxPython/wx/__init__.py
Normal file
@@ -0,0 +1,41 @@
|
||||
"""wx package
|
||||
|
||||
Provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[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
|
Reference in New Issue
Block a user