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


Python Module.parse_manifest方法代码示例

本文整理汇总了Python中module.Module.parse_manifest方法的典型用法代码示例。如果您正苦于以下问题:Python Module.parse_manifest方法的具体用法?Python Module.parse_manifest怎么用?Python Module.parse_manifest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在module.Module的用法示例。


在下文中一共展示了Module.parse_manifest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: new_module

# 需要导入模块: from module import Module [as 别名]
# 或者: from module.Module import parse_manifest [as 别名]
    def new_module(self, parent, url, source, fetchto, process_manifest=True):
        """Add new module to the pool.

        This is the only way to add new modules to the pool. Thanks to it the pool can easily
        control its content
        """
        from module import Module
        self._deps_solved = False
        if source != fetch.LOCAL:
            clean_url, branch, revision = path_mod.url_parse(url)
        else:
            clean_url, branch, revision = url, None, None
        if url in [m.raw_url for m in self
                   ]:  # check if module is not already in the pool
            # same_url_mod = [m for m in self if m.raw_url == url][0]
            # if branch != same_url_mod.branch:
            #     logging.error("Requested the same module, but different branches."
            #                   "URL: %s\n" % clean_url +
            #                   "branches: %s and %s\n" % (branch, same_url_mod.branch))
            #     sys.exit("\nExiting")
            # if revision != same_url_mod.revision:
            #     logging.error("Requested the same module, but different revisions."
            #                   "URL: %s\n" % clean_url +
            #                   "revisions: %s (from %s)\n and \n%s (from %s)\n" % (revision,
            #                                                                       parent.path,
            #                                                                       same_url_mod.revision,
            #                                                                       same_url_mod.parent.path))
            #     sys.exit("\nExiting")
            return [m for m in self if m.raw_url == url][0]
        else:
            if self.global_fetch:  # if there is global fetch parameter (HDLMAKE_COREDIR env variable)
                fetchto = self.global_fetch  # screw module's particular fetchto

            new_module = Module(
                parent=parent,
                url=url,
                source=source,
                fetchto=fetchto,
                pool=self)
            self._add(new_module)
            if not self.top_module:
                global_mod.top_module = new_module
                self.top_module = new_module
                new_module.parse_manifest()
                if process_manifest is True:
                    new_module.process_manifest()
            return new_module
开发者ID:keyru,项目名称:hdl-make,代码行数:49,代码来源:module_pool.py

示例2: new_module

# 需要导入模块: from module import Module [as 别名]
# 或者: from module.Module import parse_manifest [as 别名]
    def new_module(self, parent, url, source, fetchto):
        from module import Module
        if url in [m.url for m in self]:
            return [m for m in self if m.url == url][0]
        else:
            if self.global_fetch:            # if there is global fetch parameter (HDLMAKE_COREDIR env variable)
                fetchto  = self.global_fetch # screw module's particular fetchto
            elif global_mod.top_module:
                fetchto = global_mod.top_module.fetchto

            new_module = Module(parent=parent, url=url, source=source, fetchto=fetchto, pool=self)
            self._add(new_module)
            if not self.top_module:
                global_mod.top_module = new_module
                self.top_module = new_module
                new_module.parse_manifest()
            return new_module
开发者ID:JamesHyunKim,项目名称:hdl-make2,代码行数:19,代码来源:fetch.py


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