mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 03:34:15 +02:00
[feature][arch] supporting multi-threaded download for repository packages
This commit is contained in:
@@ -272,3 +272,8 @@ def get_human_size_str(size) -> str:
|
||||
if len(size_str.split('.')[0]) < 4:
|
||||
return '{0:.2f}'.format(float(size_str)) + ' ' + m[1]
|
||||
return str(int_size)
|
||||
|
||||
|
||||
def run(cmd: List[str], success_code: int = 0) -> Tuple[bool, str]:
|
||||
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
return p.returncode == success_code, p.stdout.decode()
|
||||
|
||||
Reference in New Issue
Block a user