本文整理汇总了Python中jhbuild.versioncontrol.Repository.branch_from_xml方法的典型用法代码示例。如果您正苦于以下问题:Python Repository.branch_from_xml方法的具体用法?Python Repository.branch_from_xml怎么用?Python Repository.branch_from_xml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jhbuild.versioncontrol.Repository
的用法示例。
在下文中一共展示了Repository.branch_from_xml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: branch_from_xml
# 需要导入模块: from jhbuild.versioncontrol import Repository [as 别名]
# 或者: from jhbuild.versioncontrol.Repository import branch_from_xml [as 别名]
def branch_from_xml(self, name, branchnode):
branch = Repository.branch_from_xml(self, name, branchnode)
# patches represented as children of the branch node
for childnode in branchnode.childNodes:
if (childnode.nodeType == childnode.ELEMENT_NODE and
childnode.nodeName == 'patch'):
patchfile = childnode.getAttribute('file')
if childnode.hasAttribute('strip'):
patchstrip = int(childnode.getAttribute('strip'))
else:
patchstrip = 0
branch.patches.append((patchfile, patchstrip))
return branch
示例2: branch_from_xml
# 需要导入模块: from jhbuild.versioncontrol import Repository [as 别名]
# 或者: from jhbuild.versioncontrol.Repository import branch_from_xml [as 别名]
def branch_from_xml(self, name, branchnode, repositories, default_repo):
try:
branch = Repository.branch_from_xml(self, name, branchnode, repositories, default_repo)
except TypeError:
raise FatalError(_('branch for %s is not correct, check the moduleset file.') % name)
# patches represented as children of the branch node
for childnode in branchnode.childNodes:
if childnode.nodeType != childnode.ELEMENT_NODE: continue
if childnode.nodeName == 'patch':
patchfile = childnode.getAttribute('file')
if childnode.hasAttribute('strip'):
patchstrip = int(childnode.getAttribute('strip'))
else:
patchstrip = 0
branch.patches.append((patchfile, patchstrip))
elif childnode.nodeName == 'quilt':
branch.quilt = get_branch(childnode, repositories, default_repo)
return branch