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/ecs/__pycache__/item.cpython-310.pyc
o

we��@sXddlZddlZddlmZmZGdd�dejj�ZGdd�de�Z	Gdd�de�Z
dS)	�N)�six�StringIOc@sJeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�
ResponseGroupz�A Generic "Response Group", which can
    be anything from the entire list of Items to
    specific response elements within an itemNcCs$||_||_g|_d|_t�|_dS)�Initialize this ItemN)�_connection�	_nodename�	_nodepath�_curobjr�_xml)�self�
connection�nodename�r�F/home/arjun/projects/env/lib/python3.10/site-packages/boto/ecs/item.py�__init__ s
zResponseGroup.__init__cCsd|jj|jfS)Nz<%s: %s>)�	__class__�__name__�__dict__�rrrr�__repr__(szResponseGroup.__repr__cCs|j�|�S�N)r�get)r�namerrrr.szResponseGroup.getcCs||j|<dSr)r)rr�valuerrr�set1szResponseGroup.setcCsd|j|j��|jfS)Nz<%s>%s</%s>)rr
�getvaluerrrr�to_xml4szResponseGroup.to_xmlcCsd|j�d|�|j�|�t|j�dkr%t|j�}|�||�||_dS|jr0|j�	|||�dS)Nz<%s>�)
r
�writer�append�lenrrrr	�startElement)rr�attrsr�objrrrr!:s
�zResponseGroup.startElementcCs�|j�dt�|��dd�|f�t|j�dkrdSd}|�|�}t|j�dkr9|s,|s2|�||�|j	r8d|_	n|j	rD|j	�
|||�|j��dS)Nz%s</%s>z	&amp;amp;z&amp;rr)r
r�cgi�escape�replacer rrrr	�
endElement�pop)rrrrr#�curvalrrrr'Es"
�
zResponseGroup.endElement)NN)r�
__module__�__qualname__�__doc__rrrrrr!r'rrrrrs
rc@seZdZdZddd�ZdS)�Itemz
A single ItemNcCst�||d�dS)rr-N)rr)rrrrrr[sz
Item.__init__r)rr*r+r,rrrrrr-Xsr-c@sFeZdZdZddd�Zdd�Zdd�Zd	d
�ZeZdd�Z	d
d�Z
dS)�ItemSetzbA special ResponseGroup that has built-in paging, and
    only creates new Items on the "Item" tagrcCsNt�||d�g|_d|_||_||_||_d|_d|_d|_	d|_
g|_dS)N�ItemsrF)rr�objs�iter�page�action�params�curItem�
total_results�total_pages�is_valid�errors)rrr3r4r2rrrrcs
zItemSet.__init__cCs6|dkrt|j�|_dS|jdur|j�|||�dS)Nr-)r-rr5r!)rrr"rrrrr!ps
�zItemSet.startElementcCs�|dkr	||_dS|dkr||_dS|dkr|dkrd|_dS|dkr.|j�|dd��dS|dkr;||jd	d<dS|d
krT|j�|j�|j�|j�	��d|_dS|jdura|j�
|||�dS)N�TotalResults�
TotalPages�IsValid�TrueT�Code)r>�Messager?���r-)r6r7r8r9rr0r5r
rrr')rrrrrrrr'ws0���	��
�zItemSet.endElementc	Cs�|jdurt|j�|_zt|j�WStyBd|_g|_t|j�t|j�krA|jd7_|j�|j	|j
|j|�t|�YS�w)zSpecial paging functionalityNr)r1r0�next�
StopIteration�intr2r7r�get_responser3r4rrrr�__next__�s
�zItemSet.__next__cCs|Srrrrrr�__iter__�szItemSet.__iter__cCs|D]}qt�|�S)z"Override to first fetch everything)rr)r�itemrrrr�s
zItemSet.to_xmlN)r)rr*r+r,rr!r'rErArFrrrrrr._s

r.)�xml.sax�xmlr$�boto.compatrr�sax�ContentHandlerrr-r.rrrr�<module>s=