HEX
Server: Apache
System: Linux pdx1-shared-a1-29 6.18.39-grsec-noble+ #4 SMP Thu Jul 23 07:53:29 UTC 2026 x86_64
User: dh_bj99yp (22285841)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/boto/file/__pycache__/bucket.cpython-312.pyc
�

ckF[���F�ddlZddlmZddlmZddlmZGd�de�Zy)�N)�Key)�SimpleResultSet)�BucketListResultSetc�t�eZdZd�Zd�Zd�Z		d	d�Zd
d�Zddejfd�Z
dejfd�Zy)�Bucketc� �||_||_y)zHInstantiate an anonymous file-based Bucket around a single key.
        N)�name�
contained_key)�selfr	r
s   �2/usr/lib/python3/dist-packages/boto/file/bucket.py�__init__zBucket.__init__s����	�*���c�*�tt|��S�N)�iterr�rs r�__iter__zBucket.__iter__%s���'��-�.�.rc� �d|jzS)Nzanonymous bucket for file://)r
rs r�__str__zBucket.__str__(s��-��0B�0B�B�BrNc�.�tj|�y)a<
        Deletes a key from the bucket.

        :type key_name: string
        :param key_name: The key name to delete

        :type version_id: string
        :param version_id: Unused in this subclass.

        :type mfa_token: tuple or list of strings
        :param mfa_token: Unused in this subclass.
        N)�os�remove)r�key_name�headers�
version_id�	mfa_tokens     r�
delete_keyzBucket.delete_key+s��	�	�	�(�rc�Z�t|j|j�}t|g�S)z�
        This method returns the single key around which this anonymous Bucket
        was instantiated.

        :rtype: SimpleResultSet
        :return: The result from file system listing the keys requested

        )rr	r
r)rr�params�keys    r�get_all_keyszBucket.get_all_keys;s'���$�)�)�T�/�/�0����u�%�%rc��|dk(r&t|jdtj��St|d�}t|j||�S)a
        Check to see if a particular key exists within the bucket.
        Returns: An instance of a Key object or None

        :type key_name: string
        :param key_name: The name of the key to retrieve

        :type version_id: string
        :param version_id: Unused in this subclass.

        :type stream_type: integer
        :param stream_type: Type of the Key - Regular File or input/output Stream

        :rtype: :class:`boto.file.key.Key`
        :returns: A Key object from this bucket.
        �-��key_type�rb)rr	�KEY_STREAM_READABLE�open)rrrrr%�fps      r�get_keyzBucket.get_keyGsC��$�s�?��t�y�y�#��0G�0G�H�H��h��%�B��t�y�y�(�B�/�/rc�H�|dk(r&t|jdtj��Stjj|�}|r4tjj
|�stj|�t|d�}t|j||�S)z�
        Creates a new key

        :type key_name: string
        :param key_name: The name of the key to create

        :rtype: :class:`boto.file.key.Key`
        :returns: An instance of the newly created key object
        r#r$�wb)	rr	�KEY_STREAM_WRITABLEr�path�dirname�exists�makedirsr()rrr%�dir_namer)s     r�new_keyzBucket.new_key_ss���s�?��t�y�y�#��0G�0G�H�H��w�w���x�0�H�������x� 8����H�%��h��%�B��t�y�y�(�B�/�/r)NNNr)�__name__�
__module__�__qualname__r
rrrr!r�KEY_REGULAR_FILEr*r3�rrrrsK��+�/�C�,0�.2�� 
&�)-��58�5I�5I�0�0 $�c�.B�.B�0rr)	r�
boto.file.keyr�boto.file.simpleresultsetr�boto.s3.bucketlistresultsetr�objectrr8rr�<module>r=s!��2
��5�;�R0�V�R0r