This commit was manufactured by cvs2svn to create tag 'wxPy_2_3_4_1'.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/wxPy_2_3_4_1@18324 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Bryan Petty
2002-12-18 06:48:23 +00:00
parent bf4a027ddb
commit ea5a206d1d
1457 changed files with 66856 additions and 42992 deletions

View File

@@ -4,3 +4,35 @@
wxTheXmlResource = wxXmlResource_Get()
wx.wxXmlNodePtr = wxXmlNodePtr
#----------------------------------------------------------------------
# Create a factory for handling the subclass property of the object tag.
def _my_import(name):
mod = __import__(name)
components = string.split(name, '.')
for comp in components[1:]:
mod = getattr(mod, comp)
return mod
class wxXmlSubclassFactory_Python(wxXmlSubclassFactory):
def __init__(self):
wxXmlSubclassFactory.__init__(self)
def Create(self, className):
assert className.find('.') != -1, "Module name must be specified!"
mname = className[:className.rfind('.')]
cname = className[className.rfind('.')+1:]
module = _my_import(mname)
klass = getattr(module, cname)
inst = klass()
return inst
wxXmlResource_AddSubclassFactory(wxXmlSubclassFactory_Python())