当前位置: 首页>>代码示例>>Python>>正文


Python Py.findClass方法代码示例

本文整理汇总了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
开发者ID:RackerWilliams,项目名称:clamp,代码行数:22,代码来源:proxymaker.py

示例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
开发者ID:philk,项目名称:clamp,代码行数:22,代码来源:__init__.py


注:本文中的org.python.core.Py.findClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。