[feature][arch] supporting multi-threaded download for repository packages

This commit is contained in:
Vinícius Moreira
2020-05-27 11:51:24 -03:00
parent 12055fe0e1
commit cec0c06e4f
24 changed files with 402 additions and 51 deletions

View File

@@ -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()