ó FRTc@slddlmZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd „ƒYZd S( iÿÿÿÿ(tsixtRulecBsJeZdZdddddd„Zd„Zd„Zd„Zd„ZRS(sH 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. cCsj||_|dkrdn||_||_t|tjƒrTtd|ƒ|_n ||_||_ dS(Nttdays( tidtNonetprefixtstatust isinstanceRt integer_typest Expirationt expirationt transition(tselfRRRR R ((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyt__init__.s   cCs d|jS(Ns (R(R ((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyt__repr__;scCsB|dkrtƒ|_|jS|dkr>tƒ|_|jSdS(Nt TransitionR (RR R R R(R tnametattrst connection((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyt startElement>s    cCs\|dkr||_n@|dkr0||_n(|dkrH||_nt|||ƒdS(NtIDtPrefixtStatus(RRRtsetattr(R RtvalueR((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyt endElementGs      cCs£d}|jdk r)|d|j7}n|d|j7}|d|j7}|jdk rp||jjƒ7}n|jdk r•||jjƒ7}n|d7}|S(Nss %ss%ss%ss(RRRRR tto_xmlR (R ts((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyRQs N( t__name__t __module__t__doc__RRRRRR(((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyRs   R cBsAeZdZddd„Zd„Zd„Zd„Zd„ZRS(s½ 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. cCs||_||_dS(N(Rtdate(R RR ((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyRgs cCsdS(N(R(R RRR((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyRkscCs:|dkrt|ƒ|_n|dkr6||_ndS(NtDaystDate(tintRR (R RRR((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyRns  cCs4|jdkrd|j}n d|j}d|S(Nson: %ss in: %s dayss(RRR (R thow_long((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyRts cCsZd}|jdk r)|d|j7}n#|jdk rL|d|j7}n|d7}|S(Ns s%ss%ss (RRR (R R((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyR{s N( RRRRRRRRR(((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyR ^s    RcBsDeZdZdddd„Zd„Zd„Zd„Zd„ZRS(s> 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. cCs||_||_||_dS(N(RR t storage_class(R RR R%((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyR‘s  cCsdS(N(R(R RRR((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyR–scCsR|dkrt|ƒ|_n0|dkr6||_n|dkrN||_ndS(NR!R"t StorageClass(R#RR R%(R RRR((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyR™s     cCs=|jdkrd|j}n d|j}d||jfS(Nson: %ss in: %s dayss(RRR R%(R R$((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyR¡s cCskd}|d|j7}|jdk r:|d|j7}n#|jdk r]|d|j7}n|d7}|S(Ns s%ss%ss%ss (R%RRR (R R((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyR¨s N( RRRRRRRRR(((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyR„s     t LifecyclecBsAeZdZd„Zd„Zd„Zdddddd„ZRS(sN A container for the rules associated with a Lifecycle configuration. cCs*|dkr&tƒ}|j|ƒ|SdS(NR(RtappendR(R RRRtrule((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyR·s    cCst|||ƒdS(N(R(R RRR((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyR¾scCs?d}|d7}x|D]}||jƒ7}qW|d7}|S(sv Returns a string containing the XML version of the Lifecycle configuration as defined by S3. s&ss(R(R RR)((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyRÁs    RtEnabledcCs)t|||||ƒ}|j|ƒdS(s 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: Transition :param transition: Indicates when an object transitions to a different storage class. N(RR((R RRRR R R)((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pytadd_ruleÍsN(RRRRRRRR+(((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pyR'²s    N(t boto.compatRtobjectRR RtlistR'(((s>/opt/freeware/lib/python2.7/site-packages/boto/s3/lifecycle.pytsF&.