PyGithub克隆函数的Python进度条

2024-05-14 07:35:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我怎样才能看到克隆过程的进展?tqdm模块不适用于单行语句。我是否应该添加git参数?任何推荐信都会有帮助。谢谢

import git

#clone to local system
git.Repo.clone_from(repo_url,path, branch='master')

Tags: 模块tofromimportgit参数clone过程
1条回答
网友
1楼 · 发布于 2024-05-14 07:35:36

GitPython source code包括:

def clone_from(cls, url, to_path, progress=None, env=None, multi_options=None, **kwargs):

^{}中定义了进度

:param progress:
    Can take one of many value types:
        * None to discard progress information
        * A function (callable) that is called with the progress information.
          Signature: ``progress(op_code, cur_count, max_count=None, message='')``.
        * An instance of a class derived from ``git.RemoteProgress`` that
          overrides the ``update()`` function.

您可以看到progress function herehere的示例

相关问题 更多 >

    热门问题