HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/awscli/customizations/__pycache__/s3events.cpython-36.pyc
3

�T_�
�@sPdZddlmZdZGdd�de�Zdd�Zdd	�Zd
d�ZGdd
�d
e�Z	dS)z+Add S3 specific event streaming output arg.�)�CustomArgumentz(Filename where the records will be savedc@seZdZdS)�DocSectionNotFoundErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib/python3.6/s3events.pyrsrcCs|jdt�|jdt�dS)Nz3building-argument-table.s3api.select-object-contentz&doc-output.s3api.select-object-content)�register�add_event_stream_output_argZ
register_last�replace_event_stream_docs)Zevent_handlersrrr�register_event_stream_argsrcKs$tdtdd|jjd|d�|d<dS)NZoutfile�stringTZpayload)�nameZ	help_textZ
cli_type_nameZpositional_arg�
stream_key�session)�S3SelectStreamOutputArgument�STREAM_HELP_TEXTZoutput_shapeZ
serialization)Zargument_tableZoperation_modelr�kwargsrrrr
"s

r
cKs^|j}d}x:|dkrDy|j�}Wqtk
r@td|��YqXqW|jd�|jd�dS)N�z======
Output
======z7Could not find the "output" section for the command: %sz======
Output
======
zdThis command generates no output.  The selected object content is written to the specified outfile.
)�docZ	pop_write�
IndexErrorr�write)Zhelp_commandrrZcurrentrrrr+s

rcs0eZdZdZ�fdd�Zdd�Zdd�Z�ZS)rTcs(tt|�jf|�||_d|_||_dS)N)�superr�__init__�_stream_key�_output_file�_session)�selfrrr)�	__class__rrr?sz%S3SelectStreamOutputArgument.__init__cCs||_|jjd|j�dS)Nz!after-call.s3.SelectObjectContent)rrr	�	save_file)rZ
parameters�valuerrr�
add_to_paramsGsz*S3SelectStreamOutputArgument.add_to_paramscKsd|j|krdS||j}t|jd��.}x&|D]}d|kr,|j|dd�q,WWdQRX||j=dS)N�wbZRecordsZPayload)r�openrr)rZparsedrZevent_stream�fpZeventrrrrLs


 z&S3SelectStreamOutputArgument.save_file)rrrZ_DOCUMENT_AS_REQUIREDrr!r�
__classcell__rr)rrr<srN)
�__doc__Zawscli.argumentsrr�	Exceptionrrr
rrrrrr�<module>
s