本文整理汇总了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