浏览代码

better logging and prevent pushing to cache

Tobias Simetsreiter 5 年之前
父节点
当前提交
98f07cbcd8
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      abe_setup.py

+ 2 - 2
abe_setup.py

@@ -63,8 +63,7 @@ class ProgressPrinter(RemoteProgress):
     def update(self,op_code,cur_count,max_count=None,message=''):
         cur_count_int = round(cur_count)
         max_count_int = round(max_count or 100)
-        print(' '.join(['' for _ in range(30)]), end='\r')
-        print(f"{cur_count_int}/{max_count_int}", str(round(100*cur_count / (max_count or 100)))+'%', end="\r")
+        print(f"\033[2K{cur_count_int}/{max_count_int}", str(round(100*cur_count / (max_count or 100)))+'%', end="\r")
 
 def clone_repo_cached( cache_dir=None, bare=False):
     def clone_repo(path, remote, ref=None, cache_dir=cache_dir, bare=bare):
@@ -84,6 +83,7 @@ def clone_repo_cached( cache_dir=None, bare=False):
                 cache = repo.remotes['cache']
             else:
                 cache = repo.create_remote('cache', real_relpath( cache_repo_path, path))
+                cache.set_url("no_push" , '--push')
             cache.fetch(refspec="+refs/remotes/origin/*:refs/remotes/origin/*",progress=ProgressPrinter())
             print()
         else: