HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/boto/s3/__pycache__/keyfile.cpython-310.pyc
o

weK�@s*dZddlZddlmZGdd�d�ZdS)z�
Wrapper class to expose a Key being read via a partial implementaiton of the
Python file interface. The only functions supported are those needed for seeking
in a Key open for reading.
�N)�StorageResponseErrorc@s�eZdZdd�Zdd�Zejfdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#S)$�KeyFilecCsF||_|j��d|_d|_d|_d|_d|_d|_d|_|j	|_	dS)NrF����rzUndefined in KeyFile)
�key�	open_read�location�closed�	softspace�mode�encoding�errors�newlines�name)�selfr�r�H/home/arjun/projects/env/lib/python3.10/site-packages/boto/s3/keyfile.py�__init__"s
zKeyFile.__init__cCs|jdur	td��|jS)NzI/O operation on closed file)r�
ValueError�rrrr�tell.s
zKeyFile.tellc
Cs|jjdd�|tjkr<|jjdkrdS|jj|d}|dkr$td��|jjdd|id�|j�d�|d|_dS|tj	krJ|dkrItd��n|tj
krU||j7}ntd	|��z
|jjdd|id�Wnty�}z|jd
krv�WYd}~nd}~ww||_dS)NT)�fastr�zInvalid argument�Rangez	bytes=%d-)�headersz(Invalid whence param (%d) passed to seeki�)
r�close�os�SEEK_END�size�IOErrorr�readr�SEEK_SET�SEEK_CURr�status)r�pos�whence�errr�seek3s6


�

���
zKeyFile.seekcCs|j|7_|j�|�S�N)rrr )rrrrrr WszKeyFile.readcCs|j��d|_d|_dS)NT)rrrr	rrrrr

z
KeyFile.closecCsdS)NFrrrrr�isatty`szKeyFile.isattycCs|jSr()rrrrr�getkeyeszKeyFile.getkeycC�td��)Nz write not implemented in KeyFile��NotImplementedError)r�bufrrr�writej�z
KeyFile.writecCr+)Nz!fileno not implemented in KeyFiler,rrrr�filenomr0zKeyFile.filenocCr+)Nz flush not implemented in KeyFiler,rrrr�flushpr0z
KeyFile.flushcCr+)Nznext not implemented in KeyFiler,rrrr�nextsr0zKeyFile.nextcCr+)Nz#readinto not implemented in KeyFiler,rrrr�readintovr0zKeyFile.readintocCr+)Nz#readline not implemented in KeyFiler,rrrr�readlineyr0zKeyFile.readlinecCr+)Nz$readlines not implemented in KeyFiler,rrrr�	readlines|r0zKeyFile.readlinescCr+)Nz#truncate not implemented in KeyFiler,rrrr�truncater0zKeyFile.truncatecCr+)Nz%writelines not implemented in KeyFiler,rrrr�
writelines�r0zKeyFile.writelinescCr+)Nz%xreadlines not implemented in KeyFiler,rrrr�
xreadlines�r0zKeyFile.xreadlinesN)�__name__�
__module__�__qualname__rrrr!r'r rr)r*r/r1r2r3r4r5r6r7r8r9rrrrr s$$r)�__doc__r�boto.exceptionrrrrrr�<module>s