本文整理汇总了Python中org.python.core.Py.findClass方法的典型用法代码示例。如果您正苦于以下问题:Python Py.findClass方法的具体用法?Python Py.findClass怎么用?Python Py.findClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.python.core.Py
的用法示例。
在下文中一共展示了Py.findClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeClass
# 需要导入模块: from org.python.core import Py [as 别名]
# 或者: from org.python.core.Py import findClass [as 别名]
def makeClass(self):
builder = get_builder()
log.debug("Entering makeClass for %r", self)
try:
import sys
log.debug("Current sys.path: %s", sys.path)
# If already defined on sys.path (including CLASSPATH), simply return this class
# if you need to tune this, derive accordingly from this class or create another CustomMaker
cls = Py.findClass(self.myClass)
log.debug("Looked up proxy: %r, %r", self.myClass, cls)
if cls is None:
raise TypeError("No proxy class")
except:
if builder:
log.debug("Calling super... for %r", self.package)
cls = CustomMaker.makeClass(self)
log.info("Built proxy: %r", self.myClass)
else:
raise TypeError("Cannot clamp proxy class {} without a defined builder".format(self.myClass))
return cls
示例2: makeClass
# 需要导入模块: from org.python.core import Py [as 别名]
# 或者: from org.python.core.Py import findClass [as 别名]
def makeClass(self):
global _builder
print "Entering makeClass", self
try:
import sys
print "sys.path", sys.path
# If already defined on sys.path (including CLASSPATH), simply return this class
# if you need to tune this, derive accordingly from this class or create another CustomMaker
cls = Py.findClass(self.myClass)
print "Looked up proxy", self.myClass, cls
if cls is None:
raise TypeError("No proxy class")
except:
if _builder:
print "Calling super...", self.package
cls = CustomMaker.makeClass(self)
print "Built proxy", self.myClass
else:
raise TypeError("FIXME better err msg - Cannot construct class without a defined builder")
return cls