ó FRTc@s§d„Zdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd efd „ƒYZd efd „ƒYZd efd„ƒYZ dS(cCs%d|}d|}d|||fS(Ns<%s>ss%s%s%s((tkeytvaluetstarttend((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyttags  tWebsiteConfigurationcBs>eZdZddddd„Zd„Zd„Zd„ZRS(s 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. cCsC||_||_||_|dk r3||_n tƒ|_dS(N(tsuffixt error_keytredirect_all_requests_totNonet routing_rulest RoutingRules(tselfRRRR ((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyt__init__7s      cCsa|dkrtƒ|_|jS|dkr>td gd|ƒS|dkr]td gd|ƒSdS( NR t IndexDocumenttSuffixRt containert ErrorDocumenttKeyR(Rssuffix(sKeys error_key(R R t _XMLKeyValue(R tnametattrst connection((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyt startElementAs    cCsdS(N((R RRR((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyt endElementJscCsØddg}|jdk r@|jtdtd|jƒƒƒn|jdk rt|jtdtd|jƒƒƒn|jdk rœ|j|jjƒƒn|jr¾|j|jjƒƒn|jdƒdj|ƒS( Ns&sFRRRRst( RR tappendRRRtto_xmlR tjoin(R tparts((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyRMs %%  N(t__name__t __module__t__doc__R R RRR(((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyRs  RcBs/eZdd„Zd„Zd„Zd„ZRS(cCs(||_|r||_n ||_dS(N(t translatorR(R R!R((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR ]s  cCsdS(N((R RRR((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyRdscCs@x9|jD].\}}||kr t|j||ƒq q WdS(N(R!tsetattrR(R RRRtxml_keyt attr_name((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyRgs cCsdg}xN|jD]C\}}t|j|ƒ}|dk r|jt||ƒƒqqWdj|ƒS(NR(R!tgetattrRR RRR(R RR#R$tcontent((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyRls  N(RRR R RRR(((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR\s   tRedirectLocationcBs2eZdZddgZd d d„Zd„ZRS( s*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. tHostNamethostnametProtocoltprotocolcCs/||_||_tt|ƒj|jƒdS(N(R)R+tsuperR'R t TRANSLATOR(R R)R+((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR ‚s  cCstdtt|ƒjƒƒS(NtRedirectAllRequestsTo(RR,R'R(R ((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR‡s(R(shostname(R*sprotocolN(RRR R-R R R(((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR'us  R cBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCs|j|ƒ|S(sØ :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 trule((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pytadd_ruleŽs cCs6|dkr2ttƒtƒƒ}|j|ƒ|SdS(Nt RoutingRule(R1t ConditiontRedirectR0(R RRRR/((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR›s  cCsdS(N((R RRR((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR¡scCsdtt|ƒjƒS(NsRoutingRules(%s)(R,R t__repr__(R ((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR4¤scCs@g}x!|D]}|j|jƒƒq Wtddj|ƒƒS(NR s (RRRR(R t inner_textR/((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR§s (RRR0RRR4R(((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR Œs    R1cBseeZdZddd„Zd„Zd„Zd„Zeddd„ƒZ dddddd„Z RS(sRepresents 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. cCs||_||_dS(N(t conditiontredirect(R R6R7((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR ¾s cCs*|dkr|jS|dkr&|jSdS(NR2R3(R6R7(R RRR((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyRÂs  cCsdS(N((R RRR((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyRÈscCs`g}|jr(|j|jjƒƒn|jrJ|j|jjƒƒntddj|ƒƒS(NR1s (R6RRR7RR(R R((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyRËs   cCs|td|d|ƒdƒS(Nt key_prefixthttp_error_code(R2R (tclsR8R9((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pytwhenÓsc Cs.td|d|d|d|d|ƒ|_|S(NR)R+t replace_keytreplace_key_prefixthttp_redirect_code(R3R7(R R)R+R<R=R>((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyt then_redirectØs   N( RRR R R RRRt classmethodR;R?(((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR1®s    R2cBs2eZdZddgZd d d„Zd„ZRS( s$ :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. tKeyPrefixEqualsR8tHttpErrorCodeReturnedEqualsR9cCs/||_||_tt|ƒj|jƒdS(N(R8R9R,R2R R-(R R8R9((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR ôs  cCstdtt|ƒjƒƒS(NR2(RR,R2R(R ((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyRùs(RAs key_prefix(RBshttp_error_codeN(RRR R-R R R(((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR2âs   R3cBsDeZdZd ddddgZdddddd „Zd „ZRS(sã :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. R*R+R(R)tReplaceKeyWithR<tReplaceKeyPrefixWithR=tHttpRedirectCodeR>cCsJ||_||_||_||_||_tt|ƒj|jƒdS(N( R)R+R<R=R>R,R3R R-(R R)R+R<R=R>((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR s      cCstdtt|ƒjƒƒS(NR3(RR,R3R(R ((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR"s(sProtocolsprotocol(sHostNameshostname(RCs replace_key(RDsreplace_key_prefix(REshttp_redirect_codeN(RRR R-R R R(((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyR3ýs  N( RtobjectRRR'tlistR R1R2R3(((s</opt/freeware/lib/python2.7/site-packages/boto/s3/website.pyts ?"4