Antonio Valentino pushed to branch upstream at Debian GIS Project / remotezip
Commits: a3eb3ae2 by Antonio Valentino at 2024-03-02T11:23:45+00:00 New upstream version 0.12.3 - - - - - 5 changed files: - PKG-INFO - remotezip.egg-info/PKG-INFO - remotezip.egg-info/requires.txt - remotezip.py - setup.py Changes: ===================================== PKG-INFO ===================================== @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: remotezip -Version: 0.12.2 +Version: 0.12.3 Summary: Access zip file content hosted remotely without downloading the full file. Home-page: https://github.com/gtsystem/python-remotezip Author: Giuseppe Tribulato ===================================== remotezip.egg-info/PKG-INFO ===================================== @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: remotezip -Version: 0.12.2 +Version: 0.12.3 Summary: Access zip file content hosted remotely without downloading the full file. Home-page: https://github.com/gtsystem/python-remotezip Author: Giuseppe Tribulato ===================================== remotezip.egg-info/requires.txt ===================================== @@ -1,5 +1,4 @@ requests -tabulate [test] requests_mock ===================================== remotezip.py ===================================== @@ -5,7 +5,6 @@ from datetime import datetime from itertools import tee import requests -from tabulate import tabulate __all__ = ['RemoteIOError', 'RemoteZip'] @@ -254,17 +253,35 @@ class RemoteZip(zipfile.ZipFile): ilist.append(self.start_dir) return {a: b-a for a, b in pairwise(ilist)} + def size(self): + return self.fp._file_size if self.fp else 0 + def _list_files(url, support_suffix_range, filenames): with RemoteZip(url, headers={'User-Agent': 'remotezip'}, support_suffix_range=support_suffix_range) as zip: if len(filenames) == 0: filenames = zip.namelist() - data = [('Length', 'DateTime', 'Name')] + data = [] for fname in filenames: zinfo = zip.getinfo(fname) dt = datetime(*zinfo.date_time) data.append((zinfo.file_size, dt.strftime('%Y-%m-%d %H:%M:%S'), zinfo.filename)) - print(tabulate(data, headers='firstrow')) + _printTable(data, ('Length', 'DateTime', 'Name'), '><<') + + +def _printTable(data, header, align): + # get max col width & prepare formatting string + col_w = [len(col) for col in header] + for row in data: + col_w = [max(w, len(str(x))) for w, x in zip(col_w, row)] + fmt = ' '.join('{{:{}{}}}'.format(a, w) + for w, a in zip(col_w, align + '<' * 99)) + # print table + print(fmt.format(*header).rstrip()) + print(fmt.format(*['-' * w for w in col_w])) + for row in data: + print(fmt.format(*row).rstrip()) + print() def _extract_files(url, support_suffix_range, filenames, path): ===================================== setup.py ===================================== @@ -5,7 +5,7 @@ with open("README.md") as f: setup( name='remotezip', - version='0.12.2', + version='0.12.3', author='Giuseppe Tribulato', author_email='[email protected]', py_modules=['remotezip'], @@ -14,7 +14,7 @@ setup( description='Access zip file content hosted remotely without downloading the full file.', long_description=description, long_description_content_type="text/markdown", - install_requires=["requests", "tabulate"], + install_requires=["requests"], extras_require={ "test": ["requests_mock"], }, View it on GitLab: https://salsa.debian.org/debian-gis-team/remotezip/-/commit/a3eb3ae213246f6fe6884b2700223fcfdc1dd009 -- View it on GitLab: https://salsa.debian.org/debian-gis-team/remotezip/-/commit/a3eb3ae213246f6fe6884b2700223fcfdc1dd009 You're receiving this email because of your account on salsa.debian.org.
_______________________________________________ Pkg-grass-devel mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-grass-devel
