本文整理匯總了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 )
示例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()
示例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