當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。