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/s3/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

ckF[�*�@s`ddlmZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGd
d�de�ZdS)
�)�sixc@s>eZdZdZ		d
dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)�RuleaH
    A Lifecycle rule for an S3 bucket.

    :ivar id: Unique identifier for the rule. The value cannot be longer
        than 255 characters. This value is optional. The server will
        generate a unique value for the rule if no value is provided.

    :ivar prefix: Prefix identifying one or more objects to which the
        rule applies. If prefix is not provided, Boto generates a default
        prefix which will match all objects.

    :ivar status: If 'Enabled', the rule is currently being applied.
        If 'Disabled', the rule is not currently being applied.

    :ivar expiration: An instance of `Expiration`. This indicates
        the lifetime of the objects that are subject to the rule.

    :ivar transition: An instance of `Transition`.  This indicates
        when to transition to a different storage class.

    NcCsz||_|dur	dn||_||_t|tj�rt|d�|_n||_t|t�r0t	�|_
|j
�|�dS|r7||_
dSt	�|_
dS)N�)�days)�id�prefix�status�
isinstancer�
integer_types�
Expiration�
expiration�
Transition�Transitions�
transition�append)�selfrrrrr�r�3/usr/lib/python3/dist-packages/boto/s3/lifecycle.py�__init__.s

z
Rule.__init__cCs
d|jS)Nz
<Rule: %s>)r�rrrr�__repr__Cs
z
Rule.__repr__cCs(|dkr|jS|dkrt�|_|jSdS)Nr
r)rrr�r�name�attrs�
connectionrrr�startElementFszRule.startElementcCsF|dkr	||_dS|dkr||_dS|dkr||_dSt|||�dS)N�ID�Prefix�Status)rrr�setattr�rr�valuerrrr�
endElementNs


zRule.endElementcCstd}|jdur|d|j7}|d|j7}|d|j7}|jdur(||j��7}|jdur4||j��7}|d7}|S)Nz<Rule>z<ID>%s</ID>z<Prefix>%s</Prefix>z<Status>%s</Status>z</Rule>)rrrr�to_xmlr�r�srrrr#Xs


zRule.to_xml)NNNNN)	�__name__�
__module__�__qualname__�__doc__rrrr"r#rrrrrs
�
rc@s:eZdZdZd
dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)rz�
    When an object will expire.

    :ivar days: The number of days until the object expires

    :ivar date: The date when the object will expire. Must be
        in ISO 8601 format.
    NcCs||_||_dS�N�r�date)rrr,rrrrns
zExpiration.__init__cC�dSr*rrrrrrr�zExpiration.startElementcCs,|dkrt|�|_dS|dkr||_dSdS)N�Days�Date)�intrr,r rrrr"us

�zExpiration.endElementcCs.|jdurd|j}d|Sd|j}d|S)N�on: %s�in: %s daysz<Expiration: %s>r+�r�how_longrrrr{s



�zExpiration.__repr__cCsBd}|jdur|d|j7}n|jdur|d|j7}|d7}|S)Nz<Expiration>�<Days>%s</Days>�<Date>%s</Date>z
</Expiration>r+r$rrrr#�s

zExpiration.to_xml)NN)	r&r'r(r)rrr"rr#rrrrres
rc@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
r
aJ
    A transition to a different storage class.

    :ivar days: The number of days until the object should be moved.

    :ivar date: The date when the object should be moved.  Should be
        in ISO 8601 format.

    :ivar storage_class: The storage class to transition to.  Valid
        values are GLACIER, STANDARD_IA.
    NcCs||_||_||_dSr*�rr,�
storage_class)rrr,r9rrrr�s
zTransition.__init__cCs.|jdurd|j}nd|j}d||jfS)Nr2r3z<Transition: %s, %s>r8r4rrrr�s

zTransition.__repr__cCsPd}|d|j7}|jdur|d|j7}n|jdur"|d|j7}|d7}|S)Nz<Transition>z<StorageClass>%s</StorageClass>r6r7z
</Transition>)r9rr,r$rrrr#�s

zTransition.to_xml�NNN)r&r'r(r)rrr#rrrrr
�s

r
c@sfeZdZdZdd�Zdd�Zdd�Zdd	�Zddd�Zd
d�Z	e
dd��Ze
dd��Ze
dd��Z
d
S)rz[
    A container for the transitions associated with a Lifecycle's Rule configuration.
    cCs"d|_d|_d|_d|_d|_dS)N��)�transition_properties�current_transition_property�	temp_days�	temp_date�temp_storage_classrrrrr�s

zTransitions.__init__cCr-r*rrrrrr�r.zTransitions.startElementcCs�|dkr
t|�|_n|dkr||_n|dkr||_|j|jkr9|�t|j|j|j��d|_|_|_d|_dS|jd7_dS)Nr/r0�StorageClassr<)r1r?r@rAr>r=rr
r rrrr"�s
zTransitions.endElementcCsd}|D]}||��7}q|S)�v
        Returns a string containing the XML version of the Lifecycle
        configuration as defined by S3.
        r�r#)rr%rrrrr#�szTransitions.to_xmlNcCst|||�}|�|�dS)aB
        Add a transition to this Lifecycle configuration.  This only adds
        the rule to the local copy.  To install the new rule(s) on
        the bucket, you need to pass this Lifecycle config object
        to the configure_lifecycle method of the Bucket object.

        :ivar days: The number of days until the object should be moved.

        :ivar date: The date when the object should be moved.  Should be
            in ISO 8601 format.

        :ivar storage_class: The storage class to transition to.  Valid
            values are GLACIER, STANDARD_IA.
        N)r
r)rrr,r9rrrr�add_transition�szTransitions.add_transitioncCs|D]}t||�SdSr*)�getattr)r�proprrrr�__first_or_default�szTransitions.__first_or_defaultcC�
|�d�S)Nr��_Transitions__first_or_defaultrrrrr��
zTransitions.dayscCrI)Nr,rJrrrrr,�rLzTransitions.datecCrI)Nr9rJrrrrr9�rLzTransitions.storage_classr:)r&r'r(r)rrr"r#rErK�propertyrr,r9rrrrr�s



rc@s6eZdZdZdd�Zdd�Zdd�Z	
	d
dd�ZdS)�	LifecyclezN
    A container for the rules associated with a Lifecycle configuration.
    cCs |dkrt�}|�|�|SdS)Nr�rr)rrrr�rulerrrrs

zLifecycle.startElementcCst|||�dSr*)rr rrrr"	szLifecycle.endElementcCs.d}|d7}|D]}||��7}q|d7}|S)rCz&<?xml version="1.0" encoding="UTF-8"?>z<LifecycleConfiguration>z</LifecycleConfiguration>rD)rr%rPrrrr#szLifecycle.to_xmlNr�EnabledcCst|||||�}|�|�dS)a�
        Add a rule to this Lifecycle configuration.  This only adds
        the rule to the local copy.  To install the new rule(s) on
        the bucket, you need to pass this Lifecycle config object
        to the configure_lifecycle method of the Bucket object.

        :type id: str
        :param id: Unique identifier for the rule. The value cannot be longer
            than 255 characters. This value is optional. The server will
            generate a unique value for the rule if no value is provided.

        :type prefix: str
        :iparam prefix: Prefix identifying one or more objects to which the
            rule applies.

        :type status: str
        :param status: If 'Enabled', the rule is currently being applied.
            If 'Disabled', the rule is not currently being applied.

        :type expiration: int
        :param expiration: Indicates the lifetime, in days, of the objects
            that are subject to the rule. The value must be a non-zero
            positive integer. A Expiration object instance is also perfect.

        :type transition: Transitions
        :param transition: Indicates when an object transitions to a
            different storage class. 
        NrO)rrrrrrrPrrr�add_ruleszLifecycle.add_rule)NrrQNN)r&r'r(r)rr"r#rRrrrrrN�s�rNN)	�boto.compatr�objectrrr
�listrrNrrrr�<module>sM&"P

https://t.me/RX1948 - 2025