[Git][debian-gis-team/remotezip][master] 4 commits: New upstream version 0.12.2
Antonio Valentino (@antonio.valentino)
gitlab at salsa.debian.org
Fri Dec 22 10:03:59 GMT 2023
Antonio Valentino pushed to branch master at Debian GIS Project / remotezip
Commits:
381cd110 by Antonio Valentino at 2023-12-22T09:08:33+00:00
New upstream version 0.12.2
- - - - -
036600e0 by Antonio Valentino at 2023-12-22T09:08:34+00:00
Update upstream source from tag 'upstream/0.12.2'
Update to upstream version '0.12.2'
with Debian dir d4e71616e3af7128d3d8751c04f401c1f3fb204b
- - - - -
c51ae10b by Antonio Valentino at 2023-12-22T09:09:11+00:00
New upstream release
- - - - -
7f366fc8 by Antonio Valentino at 2023-12-22T09:27:26+00:00
Set distribution to unstable
- - - - -
9 changed files:
- PKG-INFO
- − bin/remotezip
- debian/changelog
- 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)
=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+remotezip (0.12.2-1) unstable; urgency=medium
+
+ * New upstream release.
+
+ -- Antonio Valentino <antonio.valentino at tiscali.it> Fri, 22 Dec 2023 09:27:13 +0000
+
remotezip (0.12.1-3) unstable; urgency=medium
* Switch to dh-sequence-*.
=====================================
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/-/compare/a67adcbf774b8c39603347ee29c06d61a81f070a...7f366fc839b758c50bfb9b4f6da7abb98c91bf41
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/remotezip/-/compare/a67adcbf774b8c39603347ee29c06d61a81f070a...7f366fc839b758c50bfb9b4f6da7abb98c91bf41
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/428b28e6/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list