File: //home/arjun/projects/env/lib/python3.10/site-packages/boto/s3/__pycache__/website.cpython-310.pyc
o
weo) � @ s| d d� Z G dd� de�ZG dd� de�ZG dd� de�ZG dd � d e�ZG d
d� de�ZG dd
� d
e�ZG dd� de�Z dS )c C s d| }d| }d|||f S )Nz<%s>z</%s>z%s%s%s� )�key�value�start�endr r �H/home/arjun/projects/env/lib/python3.10/site-packages/boto/s3/website.py�tag s r c @ s6 e Zd ZdZ 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.
Nc C s0 || _ || _|| _|d ur|| _d S t� | _d S �N)�suffix� error_key�redirect_all_requests_to�
routing_rules�RoutingRules)�selfr
r r r
r r r �__init__7 s
zWebsiteConfiguration.__init__c C sF |dkrt � | _| jS |dkrtdg| d�S |dkr!tdg| d�S d S )Nr �
IndexDocument)�Suffixr
)� container�
ErrorDocument)�Keyr )r r
�_XMLKeyValue�r �name�attrs�
connectionr r r �startElementA s �z!WebsiteConfiguration.startElementc C � d S r r �r r r r r r r �
endElementJ � zWebsiteConfiguration.endElementc C s� ddg}| j d ur|�tdtd| j ��� | jd ur&|�tdtd| j��� | jd ur3|�| 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/">r r r r z</WebsiteConfiguration>� )r
�appendr r r �to_xmlr
�join�r �partsr r r r"