本文整理汇总了Python中exe.engine.genericidevice.GenericIdevice.parentNode方法的典型用法代码示例。如果您正苦于以下问题:Python GenericIdevice.parentNode方法的具体用法?Python GenericIdevice.parentNode怎么用?Python GenericIdevice.parentNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exe.engine.genericidevice.GenericIdevice
的用法示例。
在下文中一共展示了GenericIdevice.parentNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: upgradeToVersion1
# 需要导入模块: from exe.engine.genericidevice import GenericIdevice [as 别名]
# 或者: from exe.engine.genericidevice.GenericIdevice import parentNode [as 别名]
def upgradeToVersion1(self):
"""
Called to upgrade from 0.3 release
"""
self._nextNodeId = 0
self._nodeIdDict = {}
# Also upgrade all the nodes.
# This needs to be done here so that draft gets id 0
# If it's done in the nodes, the ids are assigned in reverse order
draft = getattr(self, "draft")
draft._id = self._regNewNode(draft)
draft._package = self
setattr(self, "editor", Node(self, None, _(u"iDevice Editor")))
# Add a default idevice to the editor
idevice = GenericIdevice("", "", "", "", "")
editor = getattr(self, "editor")
idevice.parentNode = editor
editor.addIdevice(idevice)
def superReg(node):
"""Registers all our nodes
because in v0 they were not registered
in this way"""
node._id = self._regNewNode(node)
node._package = self
for child in node.children:
superReg(child)
superReg(self.root)