
    vKg                    0    S SK Jr  S SKJr   " S S5      rg)    )annotations)	Generatorc                  h    \ rS rSrSrSS jrSS jrSS jrSS jrSS jr	SS jr
SS	 jrSS
 jrSrg)StreamReader   z
Generator-based stream reader.

This class doesn't support concurrent calls to :meth:`read_line`,
:meth:`read_exact`, or :meth:`read_to_eof`. Make sure calls are
serialized.

c                0    [        5       U l        SU l        g )NF)	bytearraybuffereofselfs    R/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/websockets/streams.py__init__StreamReader.__init__   s    k    c              #  r  #    SnSn U R                   R                  SU5      S-   nUS:  a  OR[        U R                   5      nX1:  a  [        SU SU S35      eU R                  (       a  [        SU S35      eS	v   Mx  X!:  a  [        SU SU S35      eU R                   S	U nU R                   S	U2	 U$ 7f)
a=  
Read a LF-terminated line from the stream.

This is a generator-based coroutine.

The return value includes the LF character.

Args:
    m: Maximum number bytes to read; this is a security limit.

Raises:
    EOFError: If the stream ends without a LF.
    RuntimeError: If the stream ends in more than ``m`` bytes.

r      
   read  bytes, expected no more than  bytesstream ends after z bytes, before end of lineN)r
   findlenRuntimeErrorr   EOFError)r   mnprs        r   	read_lineStreamReader.read_line   s         *Q.A1uDKK Au"U1#-KA3f#UVVxx!3A36PQRR  5qc)Gs&QRRKKOKKOs   B5B7c              #  :  #    US:  d   e[        U R                  5      U:  aW  U R                  (       a'  [        U R                  5      n[        SU SU S35      eSv   [        U R                  5      U:  a  MW  U R                  SU nU R                  SU2	 U$ 7f)z
Read a given number of bytes from the stream.

This is a generator-based coroutine.

Args:
    n: How many bytes to read.

Raises:
    EOFError: If the stream ends in less than ``n`` bytes.

r   r   z bytes, expected r   N)r   r
   r   r   )r   r   r   r    s       r   
read_exactStreamReader.read_exact6   s      Avv$++"xx$!3A36Gs&QRR	 $++"
 KKOKKOs   A7B; Bc              #     #    U R                   (       dC  [        U R                  5      nX!:  a  [        SU SU S35      eSv   U R                   (       d  MC  U R                  SS nU R                  SS2	 U$ 7f)z
Read all bytes from the stream.

This is a generator-based coroutine.

Args:
    m: Maximum number bytes to read; this is a security limit.

Raises:
    RuntimeError: If the stream ends in more than ``m`` bytes.

r   r   r   N)r   r   r
   r   )r   r   r   r    s       r   read_to_eofStreamReader.read_to_eofM   si      ((DKK Au"U1#-KA3f#UVV	 (((
 KKNKKNs   AA7 A7c              #  `   #     U R                   (       a  gU R                  (       a  gSv   M*  7f)za
Tell whether the stream has ended and all data was read.

This is a generator-based coroutine.

TFNr
   r   r   s    r   at_eofStreamReader.at_eofc   s(      {{xx  s   ,.c                f    U R                   (       a  [        S5      eU =R                  U-  sl        g)z
Write data to the stream.

:meth:`feed_data` cannot be called after :meth:`feed_eof`.

Args:
    data: Data to write.

Raises:
    EOFError: If the stream has ended.

stream endedN)r   r   r
   )r   datas     r   	feed_dataStreamReader.feed_datas   s$     88>**tr   c                J    U R                   (       a  [        S5      eSU l         g)zu
End the stream.

:meth:`feed_eof` cannot be called more than once.

Raises:
    EOFError: If the stream has ended.

r.   TN)r   r   r   s    r   feed_eofStreamReader.feed_eof   s     88>**r   c                "    U R                   SS2	 g)z7
Discard all buffered data, but don't end the stream.

N)r
   r   s    r   discardStreamReader.discard   s    
 KKNr   r*   N)returnNone)r   intr8   Generator[None, None, bytes])r   r:   r8   r;   )r8   zGenerator[None, None, bool])r/   bytesr8   r9   )__name__
__module____qualname____firstlineno____doc__r   r!   r$   r'   r+   r0   r3   r6   __static_attributes__ r   r   r   r      s0     D., "r   r   N)
__future__r   collections.abcr   r   rC   r   r   <module>rF      s    " %Q Qr   