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 : |
o ckF[o) � @ 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 �1/usr/lib/python3/dist-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"