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