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


Python PyUtils.wrap方法代码示例

本文整理汇总了Python中PyUtils.wrap方法的典型用法代码示例。如果您正苦于以下问题:Python PyUtils.wrap方法的具体用法?Python PyUtils.wrap怎么用?Python PyUtils.wrap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyUtils的用法示例。


在下文中一共展示了PyUtils.wrap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _addCurves

# 需要导入模块: import PyUtils [as 别名]
# 或者: from PyUtils import wrap [as 别名]
    def _addCurves(self, treeItemId, nameStack):
        """PRIVATE. Recursively add curves under this treeItemId."""
        from App.Proxys import Member
        app = wx.GetApp()

        controller = self._getSelectedController()
        phiPtr = controller.getPhiPtr()

        nodeData = self._tree.GetItemPyData( treeItemId )
        if nodeData is None : return
        try:
            # Assume the tree node contains an object
            object = nodeData.getObject()            
        except AttributeError:
            object = None
                
        if object is not None:
            proxyObject = PyUtils.wrap(object, recursive = False)
            for i in range( proxyObject.getMemberCount() ):
                value, member =  proxyObject.getValueAndInfo(i)
                if value is None: continue
                if isinstance( member, Member.Trajectory1d ):
                    name = " : ".join(nameStack[1:])
                    if member.name != "baseTrajectory" :
                        name += " : " + member.fancyName
                    app.addCurve( name, value, phiPtr )

        # Recurse on the child nodes
        currTreeItemId, cookie = self._tree.GetFirstChild( treeItemId )
        while currTreeItemId.IsOk():
            newNameStack = nameStack[:]
            newNameStack.append( self._tree.GetItemText(currTreeItemId)  )
            self._addCurves( currTreeItemId, newNameStack )
            currTreeItemId, cookie = self._tree.GetNextChild( treeItemId, cookie )        
开发者ID:MontyThibault,项目名称:cartwheel-3d-Research-Modifications,代码行数:36,代码来源:ControllerTree.py

示例2: attachObject

# 需要导入模块: import PyUtils [as 别名]
# 或者: from PyUtils import wrap [as 别名]
 def attachObject(self, object):
     self.deleteObserver()
     self._object = object
     try: 
         self._proxy = PyUtils.wrap( object, recursive = False )
     except AttributeError:
         self._proxy = None            
     try: object.addObserver(self)
     except AttributeError: pass
     self.createControls()
开发者ID:MontyThibault,项目名称:cartwheel-3d-Research-Modifications,代码行数:12,代码来源:MemberDisplay.py

示例3: get

# 需要导入模块: import PyUtils [as 别名]
# 或者: from PyUtils import wrap [as 别名]
 def get(self, object):
     result = []
     for i in range( self.getCount(object) ) :
         result.append( PyUtils.wrap( self.getObject(object,i) ) )
     return result
开发者ID:MontyThibault,项目名称:cartwheel-3d-Research-Modifications,代码行数:7,代码来源:Member.py


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