main
Vadim vtroshchinskiy 2024-11-29 14:32:28 +01:00
parent d832e93497
commit 6997dfeeb6
2 changed files with 12 additions and 9 deletions

View File

@ -43,6 +43,7 @@ from disk import *
from ntfs import *
import re
import uuid
from tqdm import tqdm
class OgProgressPrinter(git.RemoteProgress):
"""
@ -68,18 +69,18 @@ class OgProgressPrinter(git.RemoteProgress):
def __init__(self, parentLogger):
super().__init__()
self.logger = parentLogger
self.prev_len = 0
print("\n", file=sys.stderr)
if sys.stdin.isatty():
self.progress = tqdm()
def update(self, op_code, cur_count, max_count=None, message=""):
self.logger.debug(f"Progress: {op_code} {cur_count}/{max_count}: {message}")
status_string = "Progress: %s %s/%s: %s" % (op_code, cur_count, max_count, message)
padded_string = status_string.rjust(self.prev_len, " ")
self.prev_len = len(status_string)
print(f"\r{padded_string}", file=sys.stderr, end="")
if self.progress:
self.progress.total = max_count
self.progress.n = cur_count
self.progress.desc = message
self.progress.refresh()
def __del__(self):
print("\n", file=sys.stderr)

View File

@ -1,9 +1,11 @@
gitdb==4.0.11
GitPython==3.1.43
libarchive==0.4.7
libarchive-c==5.1
nose==1.3.7
pathlib==1.0.1
pkg_resources==0.0.0
pylibacl==0.7.0
pylibblkid==0.3
pyxattr==0.8.1
smmap==5.0.1
tqdm==4.66.5