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__/website.cpython-310.pyc
o

ckF[o)�@s|dd�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�Z	dS)cCsd|}d|}d|||fS)Nz<%s>z</%s>z%s%s%s�)�key�value�start�endrr�1/usr/lib/python3/dist-packages/boto/s3/website.py�tagsrc@s6eZdZdZ		ddd�Zdd�Zdd�Zd	d
�ZdS)�WebsiteConfigurationa
    Website configuration for a bucket.

    :ivar suffix: Suffix that is appended to a request that is for a
        "directory" on the website endpoint (e.g. if the suffix is
        index.html and you make a request to samplebucket/images/
        the data that is returned will be for the object with the
        key name images/index.html).  The suffix must not be empty
        and must not include a slash character.

    :ivar error_key: The object key name to use when a 4xx class error
        occurs.  This key identifies the page that is returned when
        such an error occurs.

    :ivar redirect_all_requests_to: Describes the redirect behavior for every
        request to this bucket's website endpoint. If this value is non None,
        no other values are considered when configuring the website
        configuration for the bucket. This is an instance of
        ``RedirectLocation``.

    :ivar routing_rules: ``RoutingRules`` object which specifies conditions
        and redirects that apply when the conditions are met.

    NcCs0||_||_||_|dur||_dSt�|_dS�N)�suffix�	error_key�redirect_all_requests_to�
routing_rules�RoutingRules)�selfr
rrr
rrr�__init__7s
zWebsiteConfiguration.__init__cCsF|dkrt�|_|jS|dkrtdg|d�S|dkr!tdg|d�SdS)Nr�
IndexDocument)�Suffixr
)�	container�
ErrorDocument)�Keyr)rr
�_XMLKeyValue�r�name�attrs�
connectionrrr�startElementAs�z!WebsiteConfiguration.startElementcC�dSr	r�rrrrrrr�
endElementJ�zWebsiteConfiguration.endElementcCs�ddg}|jdur|�tdtd|j���|jdur&|�tdtd|j���|jdur3|�|j���|jr>|�|j���|�d�d�|�S)	Nz&<?xml version="1.0" encoding="UTF-8"?>zF<WebsiteConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">rrrrz</WebsiteConfiguration>�)r
�appendrrr�to_xmlr
�join�r�partsrrrr"Ms�




zWebsiteConfiguration.to_xml)NNNN)�__name__�
__module__�__qualname__�__doc__rrrr"rrrrrs
�
	rc@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)rNcCs||_|r
||_dS||_dSr	)�
translatorr)rr*rrrrr]s

z_XMLKeyValue.__init__cCrr	rrrrrrdrz_XMLKeyValue.startElementcCs*|jD]\}}||krt|j||�qdSr	)r*�setattrr)rrrr�xml_key�	attr_namerrrrgs
��z_XMLKeyValue.endElementcCsBg}|jD]\}}t|j|�}|dur|�t||��qd�|�S)Nr )r*�getattrrr!rr#)rr%r,r-�contentrrrr"ls�
z_XMLKeyValue.to_xmlr	)r&r'r(rrrr"rrrrr\s

rc�6eZdZdZddgZd	�fdd�	Z�fdd�Z�ZS)
�RedirectLocationa*Specify redirect behavior for every request to a bucket's endpoint.

    :ivar hostname: Name of the host where requests will be redirected.

    :ivar protocol: Protocol to use (http, https) when redirecting requests.
        The default is the protocol that is used in the original request.

    ��HostName�hostname��Protocol�protocolNc�"||_||_tt|��|j�dSr	)r4r7�superr1r�
TRANSLATOR)rr4r7��	__class__rrr��zRedirectLocation.__init__c�tdtt|����S)N�RedirectAllRequestsTo)rr9r1r"�rr;rrr"�s�zRedirectLocation.to_xml�NN�r&r'r(r)r:rr"�
__classcell__rrr;rr1us�r1cs<eZdZdd�Zdd�Zdd�Z�fdd�Zd	d
�Z�ZS)rcCs|�|�|S)z�

        :type rule: :class:`boto.s3.website.RoutingRule`
        :param rule: A routing rule.

        :return: This ``RoutingRules`` object is returned,
            so that it can chain subsequent calls.

        )r!)r�rulerrr�add_rule�s

zRoutingRules.add_rulecCs(|dkrtt�t��}|�|�|SdS)N�RoutingRule)rF�	Condition�RedirectrE)rrrrrDrrrr�s

�zRoutingRules.startElementcCrr	rrrrrr�rzRoutingRules.endElementcsdtt|���S)NzRoutingRules(%s))r9r�__repr__r@r;rrrI�szRoutingRules.__repr__cCs,g}|D]	}|�|���qtdd�|��S)Nr�
)r!r"rr#)r�
inner_textrDrrrr"�szRoutingRules.to_xml)	r&r'r(rErrrIr"rCrrr;rr�s
rc@sNeZdZdZddd�Zdd�Zdd�Zd	d
�Zeddd��Z			dd
d�Z
dS)rFaRepresents a single routing rule.

    There are convenience methods to making creating rules
    more concise::

        rule = RoutingRule.when(key_prefix='foo/').then_redirect('example.com')

    :ivar condition: Describes condition that must be met for the
        specified redirect to apply.

    :ivar redirect: Specifies redirect behavior.  You can redirect requests to
        another host, to another page, or with another protocol. In the event
        of an error, you can can specify a different error code to return.

    NcCs||_||_dSr	��	condition�redirect)rrMrNrrrr�s
zRoutingRule.__init__cCs |dkr|jS|dkr|jSdS)NrGrHrLrrrrr�s
�zRoutingRule.startElementcCrr	rrrrrr�rzRoutingRule.endElementcCs@g}|jr
|�|j���|jr|�|j���tdd�|��S)NrFrJ)rMr!r"rNrr#r$rrrr"�szRoutingRule.to_xmlcCs|t||d�d�S)N)�
key_prefix�http_error_code)rG)�clsrOrPrrr�when�s
��zRoutingRule.whencCst|||||d�|_|S)N)r4r7�replace_key�replace_key_prefix�http_redirect_code)rHrN�rr4r7rSrTrUrrr�
then_redirect�s�zRoutingRule.then_redirectrA�NNNNN)r&r'r(r)rrrr"�classmethodrRrWrrrrrF�s
�rFcr0)
rGa$
    :ivar key_prefix: The object key name prefix when the redirect is applied.
        For example, to redirect requests for ExamplePage.html, the key prefix
        will be ExamplePage.html. To redirect request for all pages with the
        prefix docs/, the key prefix will be /docs, which identifies all
        objects in the docs/ folder.

    :ivar http_error_code: The HTTP error code when the redirect is applied. In
        the event of an error, if the error code equals this value, then the
        specified redirect is applied.

    )�KeyPrefixEqualsrO)�HttpErrorCodeReturnedEqualsrPNcr8r	)rOrPr9rGrr:)rrOrPr;rrr�r=zCondition.__init__cr>)NrG)rr9rGr"r@r;rrr"��zCondition.to_xmlrArBrrr;rrG�s
�rGcs:eZdZdZgd�Z		d�fdd�	Z�fdd�Z�ZS)	rHa�
    :ivar hostname: The host name to use in the redirect request.

    :ivar protocol: The protocol to use in the redirect request.  Can be either
    'http' or 'https'.

    :ivar replace_key: The specific object key to use in the redirect request.
        For example, redirect request to error.html.

    :ivar replace_key_prefix: The object key prefix to use in the redirect
        request. For example, to redirect requests for all pages with prefix
        docs/ (objects in the docs/ folder) to documents/, you can set a
        condition block with KeyPrefixEquals set to docs/ and in the Redirect
        set ReplaceKeyPrefixWith to /documents.

    :ivar http_redirect_code: The HTTP redirect code to use on the response.

    )r5r2)�ReplaceKeyWithrS)�ReplaceKeyPrefixWithrT)�HttpRedirectCoderUNcs4||_||_||_||_||_tt|��|j�dSr	)	r4r7rSrTrUr9rHrr:rVr;rrrszRedirect.__init__cr>)NrH)rr9rHr"r@r;rrr""r\zRedirect.to_xmlrXrBrrr;rrH�s�	rHN)
r�objectrrr1�listrrFrGrHrrrr�<module>s?"4

https://t.me/RX1948 - 2025