From 075149bb1c92e3dc5df9fd07feebe60a3c8e4fef Mon Sep 17 00:00:00 2001 From: davidovski Date: Tue, 7 Dec 2021 23:02:43 +0000 Subject: fixed issues with getting most popular package --- src/util.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/util.py') diff --git a/src/util.py b/src/util.py index fcc58f4..c84d7a3 100644 --- a/src/util.py +++ b/src/util.py @@ -10,7 +10,12 @@ DEFAULT_BAR_COLOR = colors.BLACK + colors.BG_CYAN DEFAULT_BAR_COLOR_RESET = colors.BG_BLACK + colors.CYAN def extract_tar(package_path, destination): - os.system(f"tar -h --no-overwrite-dir -xf {package_path} -C {destination}") + cmd = f"tar -h --no-overwrite-dir -xvf {package_path} -C {destination}" + + os.popen(cmd).read() + with tarfile.open(package_path) as tar: + return "\n".join(["".join(m.name[1:]) for m in tar.getmembers() if not m.isdir()]) + def add_path(*argv): a = argv[0] -- cgit v1.2.1