searching for plugins in XRCEDPATH

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44814 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Roman Rolinsky
2007-03-15 02:30:13 +00:00
parent 5ab9534bc6
commit 8c64c153a0
3 changed files with 60 additions and 33 deletions

View File

@@ -920,6 +920,11 @@ class xxxUnknown(xxxObject):
# Comment
_handlers = [] # custom handler classes/funcs
def getHandlers():
return _handlers
def setHandlers(handlers):
global _handlers
_handlers = handlers
_CFuncPtr = None # ctypes function type
def register(hndlr):
@@ -935,13 +940,18 @@ def register(hndlr):
_handlers.append(hndlr)
def load_dl(path, localname=''):
"""Load shared/dynamic library into xxx namespace."""
"""Load shared/dynamic library into xxx namespace.
If path is not absolute or relative, try to find in the module's directory.
"""
if not localname:
localname = os.path.basename(os.path.splitext(path)[0])
try:
import ctypes
global _CFuncPtr
_CFuncPtr = ctypes._CFuncPtr
_CFuncPtr = ctypes._CFuncPtr # use as a flag of loaded ctypes
#if not os.path.dirname(path) and os.path.isfile(path):
except ImportError:
wx.LogError('ctypes module not found')
globals()[localname] = None
@@ -974,10 +984,6 @@ def addHandlers():
wx.LogError('error adding XmlHandler: "%s"' % h)
print traceback.print_exc()
def clearHandlers():
global _handlers
_handlers = []
def custom(klassName, klass='unknown'):
"""Define custom control based on xrcClass.