https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/boto/sdb/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/boto/sdb/__pycache__/item.cpython-310.pyc
o

ckF[��@sddlZGdd�de�ZdS)�Nc@sTeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zddd�Z	dd�Z
dd�ZdS)�Itemat
    A ``dict`` sub-class that serves as an object representation of a
    SimpleDB item. An item in SDB is similar to a row in a relational
    database. Items belong to a :py:class:`Domain <boto.sdb.domain.Domain>`,
    which is similar to a table in a relational database.

    The keys on instances of this object correspond to attributes that are
    stored on the SDB item.

    .. tip:: While it is possible to instantiate this class directly, you may
        want to use the convenience methods on :py:class:`boto.sdb.domain.Domain`
        for that purpose. For example, :py:meth:`boto.sdb.domain.Domain.get_item`.
    �FcCs>t�|�||_||_||_d|_d|_d|_|jjj	|_	dS)a5
        :type domain: :py:class:`boto.sdb.domain.Domain`
        :param domain: The domain that this item belongs to.

        :param str name: The name of this item. This name will be used when
            querying for items using methods like
            :py:meth:`boto.sdb.domain.Domain.get_item`
        NF)
�dict�__init__�domain�name�active�
request_id�encoding�in_attribute�
connection�	converter)�selfrrr�r�//usr/lib/python3/dist-packages/boto/sdb/item.pyr&s
	z
Item.__init__cCs |dkrd|_|�dd�|_dS)N�	AttributeTr
)r�getr
)rr�attrsrrrr�startElement8szItem.startElementcCs|jdkr
d|_t�|�S|S)N�base64)r
r�decodestring)r�valuerrr�decode_value>s

zItem.decode_valuecCs6|dkr|�|�|_dS|dkr#|jr|�|�|_dS|�|�|_dS|dkrj|j|vrUt||jt�s=||jg||j<|�|�}|jrK|j�|�}||j�|�dS|�|�}|jrc|j�|�}|||j<dS|dkr�z|j	t
|�7_	WdSYdS|dkr�||_dS|dkr�d|_dSt|||�dS)N�ItemName�Name�Value�BoxUsage�	RequestIdrF)
rrr�last_key�
isinstance�listr
�decode�append�	box_usage�floatr	�setattr)rrrrrrr�
endElementEs8




zItem.endElementcCs|jj|j|d�dS)aR
        Loads or re-loads this item's attributes from SDB.

        .. warning::
            If you have changed attribute values on an Item instance,
            this method will over-write the values if they are different in
            SDB. For any local attributes that don't yet exist in SDB,
            they will be safe.
        )�itemN)r�get_attributesr�rrrr�loadfs
z	Item.loadTcCsb|j�|j||�|r-g}|D]
}||dur|�|�qt|�dkr/|j�|j|�dSdSdS)z�
        Saves this item to SDB.

        :param bool replace: If ``True``, delete any attributes on the remote
            SDB item that have a ``None`` value on this object.
        Nr)r�put_attributesrr"�len�delete_attributes)r�replace�	del_attrsrrrr�savers
��z	Item.savecCsB||vrt||t�s||g||<||�|�dS|||<dS)a�
        Helps set or add to attributes on this item. If you are adding a new
        attribute that has yet to be set, it will simply create an attribute
        named ``key`` with your given ``value`` as its value. If you are
        adding a value to an existing attribute, this method will convert the
        attribute to a list (if it isn't already) and append your new value
        to said list.

        For clarification, consider the following interactive session:

        .. code-block:: python

            >>> item = some_domain.get_item('some_item')
            >>> item.has_key('some_attr')
            False
            >>> item.add_value('some_attr', 1)
            >>> item['some_attr']
            1
            >>> item.add_value('some_attr', 2)
            >>> item['some_attr']
            [1, 2]

        :param str key: The attribute to add a value to.
        :param object value: The value to set or append to the attribute.
        N)rr r")r�keyrrrr�	add_value�s
zItem.add_valuecCs|j�|�dS)z�
        Deletes this item in SDB.

        .. note:: This local Python object remains in its current state
            after deletion, this only deletes the remote item in SDB.
        N)r�delete_itemr)rrr�delete�szItem.deleteN)rF)T)�__name__�
__module__�__qualname__�__doc__rrrr&r*r0r2r4rrrrrs

!
'r)rrrrrrr�<module>s

https://t.me/RX1948 - 2025