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


Python GenericIdevice.parentNode方法代码示例

本文整理汇总了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)
开发者ID:kohnle-lernmodule,项目名称:exeLearningPlus1_04,代码行数:33,代码来源:package.py


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