From e49d32f9313bef487d1b9dd59df660474081fd60 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Thu, 5 May 2022 18:07:07 +0300 Subject: [PATCH] improvement of picons unzipping (#102) --- app/connections.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/connections.py b/app/connections.py index a7830ea9..9562b020 100644 --- a/app/connections.py +++ b/app/connections.py @@ -476,7 +476,8 @@ def upload_data(*, settings, download_type=DownloadType.ALL, remove_unused=False from zipfile import ZipFile zip_file = f"{p_src}{os.sep}picons.zip" - p_dst = "/tmp" + p_dst = os.path.abspath(os.path.join(p_dst, os.pardir)) + log("Compressing picons...") with ZipFile(zip_file, "w") as zf: list(map(lambda p: zf.write(os.path.join(p_src, p), arcname=p), files_filter)) @@ -488,7 +489,10 @@ def upload_data(*, settings, download_type=DownloadType.ALL, remove_unused=False if compress: if not tn: callback("Telnet initialization ...") - tn = telnet(host=host, user=settings.user, password=settings.password, timeout=2) + tn = telnet(host=host, + user=settings.user, + password=settings.password, + timeout=settings.telnet_timeout) next(tn) cmd = f"unzip -q {p_dst}/picons.zip -d {settings.picons_path}"