progbar.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:odin 作者: imito 项目源码 文件源码
def pause(self):
    # ====== clear the report ====== #
    if self._last_report is not None:
      nlines = len(self._last_report.split("\n"))
      self.__pb.moveto(-nlines)
      for i in range(nlines):
        Progbar.FP.write('\r')
        Progbar.FP.write(' ' * _environ_cols_wrapper()(Progbar.FP))
        Progbar.FP.write('\r')  # place cursor back at the beginning of line
        self.__pb.moveto(1)
    else:
      nlines = 0
    # ====== clear the bar ====== #
    if self.__pb is not None:
      self.__pb.clear()
      self.__pb.moveto(-nlines)
    # ====== reset the last report ====== #
    # because we already clean everythin, set _last_report=None prevent
    # further moveto(-nlines) in add()
    self._last_report = None
    return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号