[Git][debian-gis-team/remotezip][upstream] New upstream version 0.12.2
Antonio Valentino (@antonio.valentino)
gitlab at salsa.debian.org
Fri Dec 22 10:04:10 GMT 2023
Antonio Valentino pushed to branch upstream at Debian GIS Project / remotezip
Commits:
381cd110 by Antonio Valentino at 2023-12-22T09:08:33+00:00
New upstream version 0.12.2
- - - - -
8 changed files:
- PKG-INFO
- − bin/remotezip
- remotezip.egg-info/PKG-INFO
- remotezip.egg-info/SOURCES.txt
- + remotezip.egg-info/entry_points.txt
- 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.1
+Version: 0.12.2
Summary: Access zip file content hosted remotely without downloading the full file.
Home-page: https://github.com/gtsystem/python-remotezip
Author: Giuseppe Tribulato
@@ -22,6 +22,7 @@ Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Description-Content-Type: text/markdown
+Provides-Extra: test
License-File: LICENSE
# remotezip
=====================================
bin/remotezip deleted
=====================================
@@ -1,45 +0,0 @@
-#!/usr/bin/env python
-from datetime import datetime
-
-from tabulate import tabulate
-from remotezip import RemoteZip
-
-
-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')]
- 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'))
-
-
-def extract_files(url, support_suffix_range, filenames, path):
- with RemoteZip(url, support_suffix_range=support_suffix_range) as zip:
- if len(filenames) == 0:
- filenames = zip.namelist()
- for fname in filenames:
- print('Extracting {0}...'.format(fname))
- zip.extract(fname, path=path)
-
-
-if __name__ == "__main__":
- import argparse
- import os
-
- parser = argparse.ArgumentParser(description="Unzip remote files")
- parser.add_argument('url', help='Url of the zip archive')
- parser.add_argument('filename', nargs='*', help='File to extract')
- parser.add_argument('-l', '--list', action='store_true', help='List files in the archive')
- parser.add_argument('-d', '--dir', default=os.getcwd(), help='Extract directory, default current directory')
- parser.add_argument('--disable-suffix-range-support', action='store_true', help='Use when remote server does not support suffix range (negative offset)')
-
- args = parser.parse_args()
- support_suffix_range = not args.disable_suffix_range_support
- if args.list:
- list_files(args.url, support_suffix_range, args.filename)
- else:
- extract_files(args.url, support_suffix_range, args.filename, args.dir)
=====================================
remotezip.egg-info/PKG-INFO
=====================================
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: remotezip
-Version: 0.12.1
+Version: 0.12.2
Summary: Access zip file content hosted remotely without downloading the full file.
Home-page: https://github.com/gtsystem/python-remotezip
Author: Giuseppe Tribulato
@@ -22,6 +22,7 @@ Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Description-Content-Type: text/markdown
+Provides-Extra: test
License-File: LICENSE
# remotezip
=====================================
remotezip.egg-info/SOURCES.txt
=====================================
@@ -2,9 +2,9 @@ LICENSE
README.md
remotezip.py
setup.py
-bin/remotezip
remotezip.egg-info/PKG-INFO
remotezip.egg-info/SOURCES.txt
remotezip.egg-info/dependency_links.txt
+remotezip.egg-info/entry_points.txt
remotezip.egg-info/requires.txt
remotezip.egg-info/top_level.txt
\ No newline at end of file
=====================================
remotezip.egg-info/entry_points.txt
=====================================
@@ -0,0 +1,3 @@
+[console_scripts]
+remotezip = remotezip:main
+
=====================================
remotezip.egg-info/requires.txt
=====================================
@@ -1,2 +1,5 @@
requests
tabulate
+
+[test]
+requests_mock
=====================================
remotezip.py
=====================================
@@ -1,8 +1,11 @@
+#!/usr/bin/env python
import io
import zipfile
+from datetime import datetime
from itertools import tee
import requests
+from tabulate import tabulate
__all__ = ['RemoteIOError', 'RemoteZip']
@@ -252,4 +255,45 @@ class RemoteZip(zipfile.ZipFile):
return {a: b-a for a, b in pairwise(ilist)}
-
+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')]
+ 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'))
+
+
+def _extract_files(url, support_suffix_range, filenames, path):
+ with RemoteZip(url, support_suffix_range=support_suffix_range) as zip:
+ if len(filenames) == 0:
+ filenames = zip.namelist()
+ for fname in filenames:
+ print('Extracting {0}...'.format(fname))
+ zip.extract(fname, path=path)
+
+
+def main():
+ import argparse
+ import os
+
+ parser = argparse.ArgumentParser(description="Unzip remote files")
+ parser.add_argument('url', help='Url of the zip archive')
+ parser.add_argument('filename', nargs='*', help='File to extract')
+ parser.add_argument('-l', '--list', action='store_true', help='List files in the archive')
+ parser.add_argument('-d', '--dir', default=os.getcwd(), help='Extract directory, default current directory')
+ parser.add_argument('--disable-suffix-range-support', action='store_true', help='Use when remote server does not support suffix range (negative offset)')
+
+ args = parser.parse_args()
+ support_suffix_range = not args.disable_suffix_range_support
+ if args.list:
+ _list_files(args.url, support_suffix_range, args.filename)
+ else:
+ _extract_files(args.url, support_suffix_range, args.filename, args.dir)
+
+
+if __name__ == "__main__":
+ main()
=====================================
setup.py
=====================================
@@ -5,7 +5,7 @@ with open("README.md") as f:
setup(
name='remotezip',
- version='0.12.1',
+ version='0.12.2',
author='Giuseppe Tribulato',
author_email='gtsystem at gmail.com',
py_modules=['remotezip'],
@@ -15,8 +15,12 @@ setup(
long_description=description,
long_description_content_type="text/markdown",
install_requires=["requests", "tabulate"],
- tests_require=['requests_mock'],
- scripts=['bin/remotezip'],
+ extras_require={
+ "test": ["requests_mock"],
+ },
+ entry_points={
+ 'console_scripts': ['remotezip = remotezip:main']
+ },
test_suite='test_remotezip',
classifiers=[
'Intended Audience :: Developers',
View it on GitLab: https://salsa.debian.org/debian-gis-team/remotezip/-/commit/381cd11041e028d2b0d224bff8a8d34bb5b15fd0
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/remotezip/-/commit/381cd11041e028d2b0d224bff8a8d34bb5b15fd0
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20231222/8743fdce/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list