Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename open_text to open, and open to _open #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions unzip_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def extract(self, member, path=None, pwd=None):

outpath = path/member
os.makedirs(outpath.parent, exist_ok=True)
with self.open(member) as fpin:
with self._open(member) as fpin:
with open(path/member, mode='wb') as fpout:
while True:
r = fpin.read(65536)
Expand All @@ -239,7 +239,7 @@ def matching_files(self, *globs):
if any(fnmatch.fnmatch(f.filename, g) for g in globs):
yield f

def open(self, fn):
def _open(self, fn):
if isinstance(fn, str):
f = list(self.matching_files(fn))
if not f:
Expand All @@ -260,8 +260,8 @@ def open(self, fn):
else:
error(f'unknown compression method {method}')

def open_text(self, fn):
return io.TextIOWrapper(self.open(fn))
def open(self, fn):
return io.TextIOWrapper(self._open(fn))


class RemoteZipStream(io.RawIOBase):
Expand Down