107 """Import a python object given an importable string""" 109 if not isinstance(pythonType, basestring):
110 raise TypeError(
"Unhandled type of pythonType, val:%s" % pythonType)
113 pythonTypeTokenList =
str(pythonType).split(
'.')
114 importClassString = pythonTypeTokenList.pop()
115 importClassString = importClassString.strip()
116 importPackage =
".".join(pythonTypeTokenList)
117 importType = __import__(importPackage, globals(), locals(), [importClassString], 0)
118 pythonType = getattr(importType, importClassString)
123 pythonTypeTokenList = pythonType.split(
'.')
124 importClassString =
'.'.join(pythonTypeTokenList[0:-1])
125 importedClass =
doImport(importClassString)
126 pythonType = getattr(importedClass, pythonTypeTokenList[-1])