【问题标题】:Python progress bar for PyGithub clone functionPyGithub 克隆功能的 Python 进度条
【发布时间】:2020-10-27 11:39:05
【问题描述】:

如何查看克隆过程的进度? tqdm 模块不适用于单行语句。我应该添加一个 git 参数吗?任何参考都会有所帮助。谢谢。

import git

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

【问题讨论】:

    标签: python git progress-bar tqdm


    【解决方案1】:

    GitPython source code 包括:

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

    git.remote.Remote.push 中定义了进度

    :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 的示例。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-13
      • 1970-01-01
      • 1970-01-01
      • 2016-12-22
      相关资源
      最近更新 更多