mò ÓDHc@sŽdZdZdZdZdklZdkTdkTdkl Z dk Tdee e fd„ƒYZ d e e fd „ƒYZd e efd „ƒYZd efd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdeefd„ƒYZdefd„ƒYZdefd„ƒYZdefd „ƒYZd!efd"„ƒYZd#S($s0$Id: item.py 1019 2008-06-03 05:13:16Z sa3ruby $sOSam Ruby and Mark Pilgrim s$Revision: 1019 $s,Copyright (c) 2002 Sam Ruby and Mark Pilgrim(s validatorBase(t*(s itunes_itemtitemcBsÅtZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d „Z d „Z d „Z d „Z d „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(NcCsEd|ijo'd|ijo|ithƒƒnd|ijoŽ|iƒtjow|ii}x%|o|idjo |i}qiW|i i dƒo,|it hd|i<dd<ƒƒqÑqÕnd|ijoAd |iijo*|iƒtjo|it hƒƒq&n|i oti|ƒndS( Nttitlet descriptiontguidtrsss2.tparenttelementtslash_commentst lastBuildDate(tselftchildrentlogt!ItemMustContainTitleOrDescriptiont getFeedTypet TYPE_RSS2RRtnametversiont startswitht MissingGuidt SlashDatetitunest itunes_itemtvalidate(R R((t=/web/script/rubys/feedvalidator.org/src/feedvalidator/item.pyRs  4& cCstƒtƒfS(N(t rfc2396_fullt noduplicates(R ((Rtdo_link scCstƒtƒtƒfS(N(tnonhtmltnonblankR(R ((Rtdo_title#scCs|iƒtjo\|ii}x%|o|idjo |i}q"W|idjotƒtƒfSqont ƒtƒfS(NRs0.91( R RRRRRRRRtsafeHtml(R R((Rtdo_description&s cCsN|iƒtjo+d|ijo|ithƒƒq>ntƒtƒfS(NR(R RRR R tNeedDescriptionBeforeContentRR(R ((Rtdo_content_encoded.scCstƒtƒfS(N(t ContentItemsR(R ((Rtdo_content_items4scCsI|iƒtjo |ithdd<ƒƒntƒidh|ƒS(NRs xhtml:body(R RRR tDuplicateDescriptionSemanticst htmlEatert setElement(R ((Rt do_xhtml_body7s cCsXd|ijo)|ithdd<dd<ƒƒntƒtƒtd|iƒfS(NRtcoretextsatom:idtatom_id(R R R tDuplicateItemSemanticsRRtuniqueR(R ((Rt do_atom_id<s)cCsdkl}|ƒS(N(slink(tlink(R R/((Rt do_atom_linkAs cCsdkl}|ƒtƒfS(N(scontent(tcontentR(R R1((Rt do_atom_titleEs cCsdkl}|ƒtƒfS(N(s textConstruct(R1t textConstructR(R R3((Rtdo_atom_summaryIs cCsdkl}|ƒtƒfS(N(sauthor(tauthorR(R R5((Rtdo_atom_authorMs cCsdkl}|ƒS(N(sauthor(R5(R R5((Rtdo_atom_contributorQs cCsdkl}|ƒS(N(scontent(R1(R R1((Rtdo_atom_contentUs cCsId|ijo)|ithdd<dd<ƒƒntƒtƒfS(Nt publishedR)tpubDateR*satom:published(R R R R,trfc3339R(R ((Rtdo_atom_publishedYs)cCstƒtƒfS(N(R;R(R ((Rtdo_atom_updated^scCsY|iidƒdjo9d|ijo)|ithdd<dd<ƒƒntƒS(Nt.iR5R)R*s dc:creator(R tchildtfindR R R,ttext(R ((Rt do_dc_creatoras))cCsY|iidƒdjo9d|ijo)|ithdd<dd<ƒƒntƒS(NR>itcategoryR)R*s dc:subject(R R?R@R R R,RA(R ((Rt do_dc_subjectfs))cCsY|iidƒdjo9d|ijo)|ithdd<dd<ƒƒntƒS(NR>iR:R)R*sdc:date(R R?R@R R R,tw3cdtf(R ((Rt do_dc_dateks))cCs@d|ijo)|ithdd<dd<ƒƒntƒS(NtcreativeCommons_licenseR)screativeCommons:licenseR*s cc:license(R R R R,teater(R ((Rt do_cc_licenseps)cCs@d|ijo)|ithdd<dd<ƒƒntƒS(Nt cc_licenseR)screativeCommons:licenseR*s cc:license(R R R R,R(R ((Rtdo_creativeCommons_licenseus)(t__name__t __module__RRRR R"R$R(R.R0R2R4R6R7R8R<R=RBRDRFRIRK(((RRs*                    t rss20ItemcBsGtZd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(NcCstƒtƒfS(N(RR(R ((Rt do_comments{scCstƒttƒfS(N(t enclosureRtDuplicateEnclosure(R ((Rt do_enclosure~scCs‚d|ijo)|ithdd<dd<ƒƒnd|ijo)|ithdd<dd<ƒƒntƒtƒfS(Ntdc_dateR)R:R*sdc:datetatom_publishedsatom:published(R R R R,trfc822R(R ((Rt do_pubDates ))cCsId|ijo)|ithdd<dd<ƒƒntƒtƒfS(Nt dc_creatorR)R5R*s dc:creator(R R R R,temail_with_nameR(R ((Rt do_authorˆs)cCsId|ijo)|ithdd<dd<ƒƒntƒtƒfS(Nt dc_subjectR)RCR*s dc:subject(R R R R,RCR(R ((Rt do_categorys)cCsXd|ijo)|ithdd<dd<ƒƒntƒtƒtd|iƒfS(NR+R)RR*satom:id(R R R R,RRR-R(R ((Rtdo_guid’s)cCsId|ijo)|ithdd<dd<ƒƒntƒtƒfS(Nt dc_sourceR)tsourceR*s dc:source(R R R R,R^R(R ((Rt do_source—s)( RLRMRORRRVRYR[R\R_(((RRNzs      t rss10ItemcBs5tZd„Zd„Zd„Zd„Zd„ZRS(NcCs|d|ijo,|ithd|i<dd<ƒƒnd|ijo,|ithd|i<dd<ƒƒndS(NR/RRR(R R R tMissingElementR(R ((RRs,cCsdgS(Nu+http://www.w3.org/1999/02/22-rdf-syntax-ns#uabout(u+http://www.w3.org/1999/02/22-rdf-syntax-ns#uabout((R ((RtgetExpectedAttrNames£scCstƒS(N(RA(R ((Rt do_rdfs_label¦scCstƒS(N(RA(R ((Rtdo_rdfs_comment©scCs¾|iitdfƒo¡|itdf}d|iijog|iid|it hd|i i<d|i<dd<ƒƒnKt j o>|ithd|i i<d|i<dd<ƒƒnXy•|ii|iid ƒƒp;|ithd|i i<d|i<dd<ƒƒn8|ithd|i i<d|i<dd<ƒƒWnJt j o>|it hd|i i<d|i<dd<ƒƒnX|idtƒ|iidƒo7t|i d ƒo |i i|iidƒƒq£nti|ƒS(NtlengthiiÿÿÿÿRRtattrttypeR|uurlt setEnclosure(Nslength(Nslength(Nstype(Nsurl(Nuurl(Nsurl(tintR RhtgetValueR{R tUseZeroForUnknownRtInvalidNonNegativeIntegertValidIntegerAttributeRtKeyErrortMissingAttributet ValueErrortInvalidIntegerAttributetmime_retmatchtInvalidMIMEAttributetValidMIMEAttributeR}thttpURLRithasattrRt validatorBaseRo(R ((RRoâs*,,;;<;;<$(RLRMt validatorsR‹RbRo(((RRPÞs  RcBstZd„Zd„ZRS(NcCsdgS(Nu isPermaLink(Nu isPermaLink(R{(R ((RRbscCsÿd}y¡|iid ƒ}|djo;|ithd|ii <d|i <dd<ƒƒn8|it hd|ii <d|i <dd<ƒƒ|dj}Wnt j onX|o‹t i |ttƒpdSqû|iiƒ}|id ƒp|id ƒo6|ithd|ii <d|i <ƒƒdSqûdSn­t|iƒd jo[|iiƒoK|ithd|ii <d|i <d |i<ƒƒti |ƒSn<|ithd|ii <d|i <ƒƒti |ƒSdS(Nit isPermaLinkttruetfalseRRRistag:s urn:uuid:i Rg(NR“(struesfalse(t isPermalinkR RhRƒR{tisPermalinkStrR tInvalidBooleanAttributeRRtValidBooleanAttributeR‡trfc2396RtInvalidHttpGUIDt ValidHttpGUIDRgtlowertluRtInvalidPermalinktlentisdigittNotSufficientlyUniqueR(R R—RžR–((RRs, ;7 .&:.(RLRMRbR(((RRÿs R#cBstZd„ZRS(NcCstƒtƒfS(N(t ContentBagR(R ((Rt do_rdf_Bag s(RLRMR¤(((RR#sR£cBstZd„ZRS(NcCstƒS(N(t ContentLi(R ((RRz$s(RLRMRz(((RR£#sR¥cBstZd„ZRS(NcCstƒS(N(t ContentItem(R ((Rtdo_content_item(s(RLRMR§(((RR¥'sR¦cBs#tZd„Zd„Zd„ZRS(NcCstƒtƒfS(N(trdfResourceURIR(R ((Rtdo_content_format,scCstƒtƒfS(N(R¨R(R ((Rtdo_content_encoding.scCstƒtƒfS(N(RAR(R ((Rt do_rdf_value0s(RLRMR©RªR«(((RR¦+s  N(t__doc__t __author__t __version__t __copyright__tbaseR‘R’tloggingRRt extensiontextension_itemRtextension_rss20_itemRNtextension_rss10_itemR`RpRuRyRRCR^RPRRRR#R£R¥R¦(R#RRCR£RNRPR^RyR®R‘R`R¦R­R¯RpRRRuR¥((Rt?s,  j"!