本文整理汇总了Python中dulwich.pack.Pack.iterobjects方法的典型用法代码示例。如果您正苦于以下问题:Python Pack.iterobjects方法的具体用法?Python Pack.iterobjects怎么用?Python Pack.iterobjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dulwich.pack.Pack
的用法示例。
在下文中一共展示了Pack.iterobjects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fetch_objects
# 需要导入模块: from dulwich.pack import Pack [as 别名]
# 或者: from dulwich.pack.Pack import iterobjects [as 别名]
def fetch_objects(self, determine_wants, graph_walker, progress=None):
fd, path = tempfile.mkstemp(suffix=".pack")
self.fetch_pack(determine_wants, graph_walker, lambda x: os.write(fd, x), progress)
os.close(fd)
basename = path[:-len(".pack")]
p = PackData(path)
p.create_index_v2(basename+".idx")
pack = Pack(basename)
os.remove(path)
return (len(p), pack.iterobjects())
示例2: get_objects
# 需要导入模块: from dulwich.pack import Pack [as 别名]
# 或者: from dulwich.pack.Pack import iterobjects [as 别名]
def get_objects():
pack = Pack(path[:-5])
for obj in pack.iterobjects():
yield obj