]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/contrib/xrc/_xrcextras.py
   2 # The global was removed  in favor of static accessor functions.  This is for 
   3 # backwards compatibility: 
   4 wxTheXmlResource 
= wxXmlResource_Get() 
   6 wx
.wxXmlNodePtr 
= wxXmlNodePtr
 
  11 #---------------------------------------------------------------------- 
  12 #  Create a factory for handling the subclass property of the object tag. 
  16     mod 
= __import__(name
) 
  17     components 
= name
.split('.') 
  18     for comp 
in components
[1:]: 
  19         mod 
= getattr(mod
, comp
) 
  23 class wxXmlSubclassFactory_Python(wxXmlSubclassFactory
): 
  25         wxXmlSubclassFactory
.__init
__(self
) 
  27     def Create(self
, className
): 
  28         assert className
.find('.') != -1, "Module name must be specified!" 
  29         mname 
= className
[:className
.rfind('.')] 
  30         cname 
= className
[className
.rfind('.')+1:] 
  31         module 
= _my_import(mname
) 
  32         klass 
= getattr(module
, cname
) 
  37 wxXmlResource_AddSubclassFactory(wxXmlSubclassFactory_Python())