Skip to content

Commit

Permalink
[dev] bump version to v0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
anjakefala committed Jul 7, 2024
1 parent a743cb6 commit 50dbdba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Extract individual files from .zip files over http without downloading the entir

## Usage

unzip-http [-l] [-f] [-o] <url> <filenames..>
unzip_http [-l] [-f] [-o] <url> <filenames..>

Extract <filenames> from a remote .zip at `<url>` to stdout.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def requirements():

setup(
name="unzip-http",
version="0.5.1",
version="0.6",
description="extract files from .zip files over http without downloading entire archive",
long_description=readme(),
long_description_content_type="text/markdown",
Expand Down
20 changes: 9 additions & 11 deletions unzip_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# SOFTWARE.

"""
usage: unzip-http [-h] [-l] [-f] [-o] url [files ...]
usage: unzip_http [-h] [-l] [-f] [-o] url [files ...]
Extract individual files from .zip files over http without downloading the
entire archive. HTTP server must send `Accept-Ranges: bytes` and
Expand Down Expand Up @@ -56,7 +56,7 @@
import urllib.parse


__version__ = '0.5.1'
__version__ = '0.6'


def error(s):
Expand Down Expand Up @@ -356,14 +356,6 @@ def download_file(f, rzf, args):
extract_one(of, rzf, f, str(path))


def run(args):
rzf = RemoteZipFile(args.url[0])
if args.list or len(args.files) == 0:
list_files(rzf)
else:
for f in rzf.infolist():
download_file(f, rzf, args)

def main():
parser = argparse.ArgumentParser(prog='unzip-http', \
description="Extract individual files from .zip files over http without downloading the entire archive. HTTP server must send `Accept-Ranges: bytes` and `Content-Length` in headers.")
Expand All @@ -379,7 +371,13 @@ def main():
parser.add_argument("files", nargs='*', help="Files to extract. If no filenames given, displays .zip contents (filenames and sizes). Each filename can be a wildcard glob.")

args = parser.parse_args()
run(args)

rzf = RemoteZipFile(args.url[0])
if args.list or len(args.files) == 0:
list_files(rzf)
else:
for f in rzf.infolist():
download_file(f, rzf, args)



Expand Down

0 comments on commit 50dbdba

Please sign in to comment.