Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pip._internal.network.lazy_wheel.LazyZipOverHTTP Class Reference

Public Member Functions

None __init__ (self, str url, PipSession session, int chunk_size=CONTENT_CHUNK_SIZE)
 
str mode (self)
 
str name (self)
 
bool seekable (self)
 
None close (self)
 
bool closed (self)
 
bytes read (self, int size=-1)
 
bool readable (self)
 
int seek (self, int offset, int whence=0)
 
int tell (self)
 
int truncate (self, Optional[int] size=None)
 
bool writable (self)
 
"LazyZipOverHTTP" __enter__ (self)
 
None __exit__ (self, *Any exc)
 

Protected Member Functions

Generator[None, None, None] _stay (self)
 
None _check_zip (self)
 
Response _stream_response (self, int start, int end, Dict[str, str] base_headers=HEADERS)
 
Generator[Tuple[int, int], None, None] _merge (self, int start, int end, int left, int right)
 
None _download (self, int start, int end)
 

Protected Attributes

 _session
 
 _url
 
 _chunk_size
 
 _length
 
 _file
 

Detailed Description

File-like object mapped to a ZIP file over HTTP.

This uses HTTP range requests to lazily fetch the file's content,
which is supposed to be fed to ZipFile.  If such requests are not
supported by the server, raise HTTPRangeRequestUnsupported
during initialization.

Member Function Documentation

◆ _check_zip()

None pip._internal.network.lazy_wheel.LazyZipOverHTTP._check_zip (   self)
protected
Check and download until the file is a valid ZIP.

◆ _download()

None pip._internal.network.lazy_wheel.LazyZipOverHTTP._download (   self,
int  start,
int  end 
)
protected
Download bytes from start to end inclusively.

◆ _merge()

Generator[Tuple[int, int], None, None] pip._internal.network.lazy_wheel.LazyZipOverHTTP._merge (   self,
int  start,
int  end,
int  left,
int   right 
)
protected
Return a generator of intervals to be fetched.

Args:
    start (int): Start of needed interval
    end (int): End of needed interval
    left (int): Index of first overlapping downloaded data
    right (int): Index after last overlapping downloaded data

◆ _stay()

Generator[None, None, None] pip._internal.network.lazy_wheel.LazyZipOverHTTP._stay (   self)
protected
Return a context manager keeping the position.

At the end of the block, seek back to original position.

◆ _stream_response()

Response pip._internal.network.lazy_wheel.LazyZipOverHTTP._stream_response (   self,
int  start,
int  end,
Dict[str, str]   base_headers = HEADERS 
)
protected
Return HTTP response to a range request from start to end.

◆ close()

None pip._internal.network.lazy_wheel.LazyZipOverHTTP.close (   self)
Close the file.

◆ closed()

bool pip._internal.network.lazy_wheel.LazyZipOverHTTP.closed (   self)
Whether the file is closed.

◆ mode()

str pip._internal.network.lazy_wheel.LazyZipOverHTTP.mode (   self)
Opening mode, which is always rb.

◆ name()

str pip._internal.network.lazy_wheel.LazyZipOverHTTP.name (   self)
Path to the underlying file.

◆ read()

bytes pip._internal.network.lazy_wheel.LazyZipOverHTTP.read (   self,
int   size = -1 
)
Read up to size bytes from the object and return them.

As a convenience, if size is unspecified or -1,
all bytes until EOF are returned.  Fewer than
size bytes may be returned if EOF is reached.

◆ readable()

bool pip._internal.network.lazy_wheel.LazyZipOverHTTP.readable (   self)
Return whether the file is readable, which is True.

◆ seek()

int pip._internal.network.lazy_wheel.LazyZipOverHTTP.seek (   self,
int  offset,
int   whence = 0 
)
Change stream position and return the new absolute position.

Seek to offset relative position indicated by whence:
* 0: Start of stream (the default).  pos should be >= 0;
* 1: Current position - pos may be negative;
* 2: End of stream - pos usually negative.

◆ seekable()

bool pip._internal.network.lazy_wheel.LazyZipOverHTTP.seekable (   self)
Return whether random access is supported, which is True.

◆ tell()

int pip._internal.network.lazy_wheel.LazyZipOverHTTP.tell (   self)
Return the current position.

◆ truncate()

int pip._internal.network.lazy_wheel.LazyZipOverHTTP.truncate (   self,
Optional[int]   size = None 
)
Resize the stream to the given size in bytes.

If size is unspecified resize to the current position.
The current stream position isn't changed.

Return the new file size.

◆ writable()

bool pip._internal.network.lazy_wheel.LazyZipOverHTTP.writable (   self)
Return False.

The documentation for this class was generated from the following file: