ó
    &ÝNjwJ  ã                   óR   • S SK Jr  S SKJrJrJrJrJr  S SKJ	r	J
r
   " S S\	5      rg)é    )ÚBytesIO)Úlinefeed_byte_valueÚcrlfÚcr_byteÚlinefeed_byteÚcr_byte_value)ÚClosingContextManagerÚuc                   óø   • \ rS rSrSrSrSrSrSrSr	Sr
SrSrS	rS
rSrS rS rS rS rS rS rS rS rS rS rS'S jrS'S jrS'S jrS(S jrS rS rS r S r!\"S 5       r#S  r$S! r%S" r&S)S# jr'S$ r(S% r)S&r*g)*ÚBufferedFileé   zW
Reusable base class to implement Python-style file buffering around a
simpler stream.
i    r   é   é   é   é   é    é@   é€   c                 óÄ   • S U l         SU l        U R                  U l        [	        5       U l        [        5       U l        SU l        SU l	        S=U l
        U l        SU l        g )Nr   F)ÚnewlinesÚ_flagsÚ_DEFAULT_BUFSIZEÚ_bufsizer   Ú_wbufferÚbytesÚ_rbufferÚ_at_trailing_crÚ_closedÚ_posÚ_realposÚ_size©Úselfs    ÚJ/home/mande/repo/quber/.venv/lib/python3.13/site-packages/paramiko/file.pyÚ__init__ÚBufferedFile.__init__3   sU   € ØˆŒØˆŒØ×-Ñ-ˆŒÜ›	ˆŒÜ›ˆŒØ$ˆÔØˆŒð %&Ð%ˆŒ	�D”Màˆ�
ó    c                 ó$   • U R                  5         g ©N)Úcloser"   s    r$   Ú__del__ÚBufferedFile.__del__B   s   € Ø�
‰
�r'   c                 ó>   • U R                   (       a  [        S5      eU $ )zÕ
Returns an iterator that can be used to iterate over the lines in this
file.  This iterator happens to return the file itself, since a file is
its own iterator.

:raises: ``ValueError`` -- if the file is closed.
zI/O operation on closed file)r   Ú
ValueErrorr"   s    r$   Ú__iter__ÚBufferedFile.__iter__E   s   € ð �<�<ÜÐ;Ó<Ð<Øˆr'   c                 ó2   • U R                  5         SU l        g)z>
Close the file.  Future read and write operations will fail.
TN)Úflushr   r"   s    r$   r*   ÚBufferedFile.closeQ   s   € ð 	�
‰
ŒØˆ�r'   c                 ót   • U R                  U R                  R                  5       5        [        5       U l        g)zc
Write out any data in the write buffer.  This may do nothing if write
buffering is not turned on.
N)Ú
_write_allr   Úgetvaluer   r"   s    r$   r2   ÚBufferedFile.flushX   s)   € ð
 	�‰˜Ÿ™×.Ñ.Ó0Ô1Ü›	ˆŒØr'   c                 ó@   • U R                  5       nU(       d  [        eU$ )aP  
Returns the next line from the input, or raises ``StopIteration``
when EOF is hit.  Unlike python file objects, it's okay to mix
calls to `.next` and `.readline`.

:raises: ``StopIteration`` -- when the end of the file is reached.

:returns:
    a line (`str`, or `bytes` if the file was opened in binary mode)
    read from the file.
)ÚreadlineÚStopIteration)r#   Úlines     r$   Ú__next__ÚBufferedFile.__next__a   s   € ð �}‰}‹ˆÞÜÐØˆr'   c                 óN   • U R                   U R                  -  U R                  :H  $ )z‰
Check if the file can be read from.

:returns:
    `True` if the file can be read from. If `False`, `read` will raise
    an exception.
)r   Ú	FLAG_READr"   s    r$   ÚreadableÚBufferedFile.readabler   s    € ð —‘˜dŸn™nÑ,°·±Ñ?Ð?r'   c                 óN   • U R                   U R                  -  U R                  :H  $ )zŒ
Check if the file can be written to.

:returns:
    `True` if the file can be written to. If `False`, `write` will
    raise an exception.
)r   Ú
FLAG_WRITEr"   s    r$   ÚwritableÚBufferedFile.writable|   s    € ð —‘˜dŸo™oÑ-°$·/±/ÑAÐAr'   c                 ó   • g)z•
Check if the file supports random access.

:returns:
    `True` if the file supports random access. If `False`, `seek` will
    raise an exception.
F© r"   s    r$   ÚseekableÚBufferedFile.seekable†   s   € ð r'   c                 óf   • U R                  [        U5      5      nX!S[        U5      & [        U5      $ )zˆ
Read up to ``len(buff)`` bytes into ``bytearray`` *buff* and return the
number of bytes read.

:returns:
    The number of bytes read.
N)ÚreadÚlen)r#   ÚbuffÚdatas      r$   ÚreadintoÚBufferedFile.readinto�   s.   € ð �y‰yœ˜T›Ó#ˆØ ˆ[Œs�4‹yÐÜ�4‹yÐr'   Nc                 ón  • U R                   (       a  [        S5      eU R                  U R                  -  (       d  [        S5      eUb  US:  aÌ  [	        U R
                  5      n[        5       U l        U =R                  [        U5      -  sl          U R                  U R                  5      nUb  [        U5      S:X  a  OOUR                  U5        U =R                  [        U5      -  sl        U =R                  [        U5      -  sl        M~  [        U5      $ U[        U R
                  5      ::  aC  U R
                  SU nU R
                  US U l        U =R                  [        U5      -  sl        U$ [        U R
                  5      U:  a¿  U[        U R
                  5      -
  nU R                  U R                  -  (       a  [        U R                   U5      n U R                  U5      nUb  [        U5      S:X  a  ONU =R
                  U-  sl        U =R                  [        U5      -  sl        [        U R
                  5      U:  a  M¿  U R
                  SU nU R
                  US U l        U =R                  [        U5      -  sl        U$ ! [         a    Sn GNóf = f! [         a    Sn NÅf = f)a1  
Read at most ``size`` bytes from the file (less if we hit the end of
the file first).  If the ``size`` argument is negative or omitted,
read all the remaining data in the file.

.. note::
    ``'b'`` mode flag is ignored (``self.FLAG_BINARY`` in
    ``self._flags``), because SSH treats all files as binary, since we
    have no idea what encoding the file is in, or even if the file is
    text data.

:param int size: maximum number of bytes to read
:returns:
    data read from the file (as bytes), or an empty string if EOF was
    encountered immediately
úFile is closedzFile is not open for readingNr   )r   ÚIOErrorr   r?   Ú	bytearrayr   r   r   rL   Ú_readr   ÚEOFErrorÚextendr    ÚFLAG_BUFFEREDÚmaxr   )r#   ÚsizeÚresultÚnew_dataÚ	read_sizes        r$   rK   ÚBufferedFile.readœ   s,  € ð" �<�<ÜÐ*Ó+Ð+Ø—‘˜dŸn™n×,ÜÐ8Ó9Ð9Ø‰L˜d Q›hä˜tŸ}™}Ó-ˆFÜ!›GˆDŒMØ�IŠIœ˜V›Ñ$�IØð$Ø#Ÿz™z¨$×*?Ñ*?Ó@�Hð Ñ$¬#¨h«-¸1Ó*<ØØ—‘˜hÔ'Ø—’¤ X£Ñ.•Ø—	’	œS ›]Ñ*•	ñ ô ˜“=Ð Ø”3�t—}‘}Ó%Ó%Ø—]‘] 5 DÐ)ˆFØ ŸM™M¨$¨%Ð0ˆDŒMØ�IŠIœ˜V›Ñ$�IØˆMÜ�$—-‘-Ó  4Ó'Øœs 4§=¡=Ó1Ñ1ˆIØ�{‰{˜T×/Ñ/×/Ü §¡¨yÓ9�	ð ØŸ:™: iÓ0�ð Ñ ¤c¨(£m°qÓ&8ØØ�MŠM˜XÑ%�MØ�MŠMœS ›]Ñ*�Mô �$—-‘-Ó  4Õ'ð —‘˜u Ð%ˆØŸ™ d eÐ,ˆŒØ�	Š	”S˜“[Ñ �	Øˆøô9  ó $Ø#“Hð$ûô& ó  Ø’ð ús$   ÂJ ÇJ% ÊJ"Ê!J"Ê%J4Ê3J4c                 ó2  • U R                   (       a  [        S5      eU R                  U R                  -  (       d  [        S5      eU R                  nSn U R
                  (       aq  U R                  U R                  -  (       aS  [        U5      S:”  aD  US   [        :X  a  USS nU R                  [        5        OU R                  [        5        SU l        Ub5  US:¼  a/  [        U5      U:¼  a  X!S U l        USU nSnOïU[        U5      -
  nOU R                  n[        U;   d(  U R                  U R                  -  (       a  [        U;   a  O¡ U R                  U5      nUb  [        U5      S:X  aX  [!        5       U l        U =R"                  [        U5      -  sl        U R                  U R$                  -  (       a  U$ ['        U5      $ X%-  nU =R(                  [        U5      -  sl        GMš  UR+                  [        5      nU R                  U R                  -  (       a(  UR+                  [        5      nUS:¼  a  Xv:  d  US:  a  UnUS:X  aI  U =R"                  [        U5      -  sl        U R                  U R$                  -  (       a  U$ ['        U5      $ US-   nX&   [,        :X  a   U[        U5      :  a  X(   [        :X  a  US-  nU(       a  X(S U R                  -   U l        O	X(S U l        X&U n	USU [        -   n[        U R                  5      S:X  a  U	[        :X  a  SU l        OU R                  U	5        U =R"                  [        U5      -  sl        U R                  U R$                  -  (       a  U$ ['        U5      $ ! [         a    Sn GN5f = f)	aE  
Read one entire line from the file.  A trailing newline character is
kept in the string (but may be absent when a file ends with an
incomplete line).  If the size argument is present and non-negative, it
is a maximum byte count (including the trailing newline) and an
incomplete line may be returned.  An empty string is returned only when
EOF is encountered immediately.

.. note::
    Unlike stdio's ``fgets``, the returned string contains null
    characters (``'\0'``) if they occurred in the input.

:param int size: maximum length of returned string.
:returns:
    next line of the file, or an empty string if the end of the
    file has been reached.

    If the file was opened in binary (``'b'``) mode: bytes are returned
    Else: the encoding of the file is assumed to be UTF-8 and character
    strings (`str`) are returned
rR   zFile not open for readingFTr   r   Néÿÿÿÿ)r   rS   r   r?   r   r   ÚFLAG_UNIVERSAL_NEWLINErL   r   Ú_record_newliner   r   r   r   rU   rV   r   r   ÚFLAG_BINARYr
   r    Úfindr   )
r#   rZ   r;   Ú	truncatedÚnr\   ÚposÚrposÚxposÚlfs
             r$   r9   ÚBufferedFile.readline×   s  € ð. �<�<ÜÐ*Ó+Ð+Ø—‘˜dŸn™n×,ÜÐ5Ó6Ð6Ø�}‰}ˆØˆ	Øà×$×$Ø—K‘K $×"=Ñ"=×=Ü˜“I “Mð ˜‘7Ô1Ó1Ø  ˜8�DØ×(Ñ(¬Õ.à×(Ñ(¬Ô1Ø',�Ô$ð Ñ  t¨q£yÜ�t“9 Ó$à$(¨ K�D”MØ  ˜;�DØ $�IØØœ3˜t›9Ñ$‘à—M‘M�Ü Ó$Ø—‘˜d×9Ñ9×9¼gÈ»oàð ØŸ:™: a›=�ð Ñ ¤c¨(£m°qÓ&8Ü %£�”Ø—	’	œS ›YÑ&•	Ø#Ÿ{™{¨T×-=Ñ-=×=�tÐJÄ1ÀTÃ7ÐJØÑˆDØ�MŠMœS ›]Ñ*�MòO ðR �i‰iœÓ&ˆØ�;‰;˜×4Ñ4×4Ø—9‘9œWÓ%ˆDØ˜“	 £
¨c°A«gØ�Ø�"‹9à�IŠIœ˜T›Ñ"�IØŸ;™;¨×)9Ñ)9×9�4ÐF¼qÀ»wÐFØ�Q‰wˆà‰IœÓ&Ø”s˜4“yÓ Ø‘
Ô1Ó1à�A‰IˆDö Ø  ˜K¨$¯-©-Ñ7ˆD�Mà  ˜KˆDŒMà�dˆ^ˆØ�D�SˆzœMÑ)ˆÜ�—‘Ó !Ó#¨"´«-ð $(ˆDÕ à× Ñ  Ô$Ø�	Š	”S˜“YÑ�	Ø—{‘{ T×%5Ñ%5×5ˆtÐB¼1¸T»7ÐBøôU ó  Ø“ð ús   ÅN ÎNÎNc                 ó¨   • / nSn U R                  5       n[        U5      S:X  a   U$ UR                  U5        U[        U5      -  nUb  X1:¼  a   U$ MN  )av  
Read all remaining lines using `readline` and return them as a list.
If the optional ``sizehint`` argument is present, instead of reading up
to EOF, whole lines totalling approximately sizehint bytes (possibly
after rounding up to an internal buffer size) are read.

:param int sizehint: desired maximum number of bytes to read.
:returns: list of lines read from the file.
r   )r9   rL   Úappend)r#   ÚsizehintÚlinesÚ
byte_countr;   s        r$   Ú	readlinesÚBufferedFile.readlines@  se   € ð ˆØˆ
ØØ—=‘=“?ˆDÜ�4‹y˜A‹~Øð
 ˆð	 �L‰L˜ÔØœ#˜d›)Ñ#ˆJØÑ$¨:Ó+AØØˆñ r'   c                 ó   • [        S5      e)aD  
Set the file's current position, like stdio's ``fseek``.  Not all file
objects support seeking.

.. note::
    If a file is opened in append mode (``'a'`` or ``'a+'``), any seek
    operations will be undone at the next write (as the file position
    will move back to the end of the file).

:param int offset:
    position to move to within the file, relative to ``whence``.
:param int whence:
    type of movement: 0 = absolute; 1 = relative to the current
    position; 2 = relative to the end of the file.

:raises: ``IOError`` -- if the file doesn't support random access.
zFile does not support seeking.©rS   )r#   ÚoffsetÚwhences      r$   ÚseekÚBufferedFile.seekV  s   € ô$ Ð6Ó7Ð7r'   c                 ó   • U R                   $ )zÑ
Return the file's current position.  This may not be accurate or
useful if the underlying file doesn't support random access, or was
opened in append mode.

:returns: file position (`number <int>` of bytes).
)r   r"   s    r$   ÚtellÚBufferedFile.tellj  s   € ð �y‰yÐr'   c                 óH  • [        U[        5      (       a  UR                  S5      nU R                  (       a  [	        S5      eU R
                  U R                  -  (       d  [	        S5      eU R
                  U R                  -  (       d  U R                  U5        gU R                  R                  U5        U R
                  U R                  -  (       a–  UR                  [        5      nUS:¼  az  U R                  R                  5       nU[        U5      [        U5      -
  -  nU R                  USUS-    5        [!        5       U l	        U R                  R                  X2S-   S 5        gU R                  R#                  5       U R$                  :¼  a  U R'                  5         g)a  
Write data to the file.  If write buffering is on (``bufsize`` was
specified and non-zero), some or all of the data may not actually be
written yet.  (Use `flush` or `close` to force buffered data to be
written out.)

:param data: ``str``/``bytes`` data to write
zutf-8rR   zFile not open for writingNr   r   )Ú
isinstanceÚstrÚencoder   rS   r   rC   rX   r5   r   ÚwriteÚFLAG_LINE_BUFFEREDÚrfindr   r6   rL   r   rz   r   r2   )r#   rN   Úlast_newline_posÚwbufs       r$   r€   ÚBufferedFile.writet  s>  € ô �dœC× Ñ à—;‘;˜wÓ'ˆDØ�<�<ÜÐ*Ó+Ð+Ø—‘˜dŸo™o×-ÜÐ5Ó6Ð6Ø—‘˜d×0Ñ0×0Ø�O‰O˜DÔ!ØØ�‰×Ñ˜DÔ!Ø�;‰;˜×0Ñ0×0à#Ÿz™z¬-Ó8ÐØ 1Ó$Ø—}‘}×-Ñ-Ó/�Ø ¤C¨£I´°D³	Ñ$9Ñ9Ð Ø—‘ Ð%;Ð'7¸!Ñ';Ð <Ô=Ü '£	�”Ø—‘×#Ñ# D¸AÑ)=Ð)?Ð$@ÔAØð �=‰=×ÑÓ 4§=¡=Ó0Ø�J‰JŒLØr'   c                 ó8   • U H  nU R                  U5        M     g)a  
Write a sequence of strings to the file.  The sequence can be any
iterable object producing strings, typically a list of strings.  (The
name is intended to match `readlines`; `writelines` does not add line
separators.)

:param sequence: an iterable sequence of strings.
N)r€   )r#   Úsequencer;   s      r$   Ú
writelinesÚBufferedFile.writelines˜  s   € ó ˆDØ�J‰J�tÖñ àr'   c                 ó   • U $ )zg
Identical to ``iter(f)``.  This is a deprecated file interface that
predates Python iterator support.
rG   r"   s    r$   Ú
xreadlinesÚBufferedFile.xreadlines¥  s	   € ð
 ˆr'   c                 ó   • U R                   $ r)   )r   r"   s    r$   ÚclosedÚBufferedFile.closed¬  s   € à�|‰|Ðr'   c                 ó   • [        5       e)zh
(subclass override)
Read data from the stream.  Return ``None`` or raise ``EOFError`` to
indicate EOF.
)rV   )r#   rZ   s     r$   rU   ÚBufferedFile._read²  s   € ô ‹jÐr'   c                 ó   • [        S5      e)z1
(subclass override)
Write data into the stream.
zwrite not implementedrt   )r#   rN   s     r$   Ú_writeÚBufferedFile._writeº  s   € ô
 Ð-Ó.Ð.r'   c                 ó   • g)a1  
(subclass override)
Return the size of the file.  This is called from within `_set_mode`
if the file is opened in append mode, so the file position can be
tracked and `seek` and `tell` will work correctly.  If the file is
a stream that can't be randomly accessed, you don't need to override
this method,
r   rG   r"   s    r$   Ú	_get_sizeÚBufferedFile._get_sizeÁ  s   € ð r'   c                 ó¨  • U R                   U l        US:  a  SnUS:X  a-  U =R                  U R                  U R                  -  -  sl        OUS:”  aF  X l        U =R                  U R                  -  sl        U =R                  U R                  ) -  sl        O3US:X  a-  U =R                  U R                  U R                  -  ) -  sl        SU;   d  SU;   a  U =R                  U R
                  -  sl        SU;   d  SU;   a  U =R                  U R                  -  sl        SU;   aY  U =R                  U R                  U R                  -  -  sl        U R                  5       U l	        U R                  =U l
        U l        SU;   a  U =R                  U R                  -  sl        SU;   a'  U =R                  U R                  -  sl        S	U l        g	g	)
z=
Subclasses call this method to initialize the BufferedFile.
r   r   ÚrÚ+ÚwÚaÚbÚUN)r   r   r   rX   r�   r?   rC   ÚFLAG_APPENDr–   r!   r   r    rc   ra   r   )r#   ÚmodeÚbufsizes      r$   Ú	_set_modeÚBufferedFile._set_modeÎ  sm  € ð
 ×-Ñ-ˆŒØ�Q‹;ð ˆGØ�a‹<ð �KŠK˜4×-Ñ-°×0GÑ0GÑGÑGŽKØ�q‹[Ø#ŒMØ�KŠK˜4×-Ñ-Ñ-�KØ�KŠK˜D×3Ñ3Ð3Ñ3ŽKØ˜‹\à�KŠK˜T×/Ñ/°$×2IÑ2IÑIÐJÑJ�Kà�4‹K˜S D›[Ø�KŠK˜4Ÿ>™>Ñ)�KØ�4‹K˜S D›[Ø�KŠK˜4Ÿ?™?Ñ*�KØ�$‹;Ø�KŠK˜4Ÿ?™?¨T×-=Ñ-=Ñ=Ñ=�KØŸ™Ó)ˆDŒJØ(,¯
©
Ð2ˆDŒI˜œØ�$‹;Ø�KŠK˜4×+Ñ+Ñ+�KØ�$‹;Ø�KŠK˜4×6Ñ6Ñ6�Kð !ˆD�Mð r'   c                 óp  • [        U5      n[        U5      S:”  aœ  U R                  U5      nX#S  nU R                  U R                  -  (       a.  U =R
                  U-  sl        U R
                  =U l        U l        O*U =R                  U-  sl        U =R                  U-  sl        [        U5      S:”  a  Mœ  g )Nr   )Ú
memoryviewrL   r“   r   rŸ   r!   r   r    )r#   Úraw_datarN   Úcounts       r$   r5   ÚBufferedFile._write_allö  s�   € ô ˜(Ó#ˆÜ�$‹i˜!‹mØ—K‘K Ó%ˆEØ˜�<ˆDØ�{‰{˜T×-Ñ-×-Ø—
’
˜eÑ#•
Ø,0¯J©JÐ6�”	˜D�Mà—	’	˜UÑ"•	Ø—’ Ñ&•ô �$‹i˜!�mð r'   c                 ó<  • U R                   U R                  -  (       d  g U R                  c  Xl        g U R                  U:w  a3  [        U R                  [        5      (       a  U R                  U4U l        g XR                  ;  a  U =R                  U4-  sl        g g r)   )r   ra   r   r}   r   )r#   Únewlines     r$   rb   ÚBufferedFile._record_newline  ss   € ð —‘˜d×9Ñ9×9ØØ�=‰=Ñ Ø#�MØ�]‰]˜gÓ%¬*°T·]±]ÄE×*JÑ*JØ!Ÿ]™]¨GÐ4ˆD�MØŸM™MÓ)Ø�MŠM˜g˜ZÑ'ŽMð *r'   )
r   r   r   r   r   r   r    r!   r   r   r)   )r   )r™   r`   )+Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚSEEK_SETÚSEEK_CURÚSEEK_ENDr?   rC   rŸ   rc   rX   r�   ra   r%   r+   r/   r*   r2   r<   r@   rD   rH   rO   rK   r9   rq   rw   rz   r€   rˆ   r‹   ÚpropertyrŽ   rU   r“   r–   r¢   r5   rb   Ú__static_attributes__rG   r'   r$   r   r      s×   † ñð
 Ðà€HØ€HØ€Hà€IØ€JØ€KØ€KØ€MØÐØ!Ðòòò
òòòò"@òBòò
ô9ôvgCôRô,8ò(ò"òHòð ñó ðò
ò/ò	ô&!òPõ(r'   r   N)Úior   Úparamiko.commonr   r   r   r   r   Úparamiko.utilr	   r
   r   rG   r'   r$   Ú<module>r¹      s(   ðõ$ ÷õ ÷ 3ôq(Ð(õ q(r'   