4McO@sQdZdddd!dZdZdZdd d d d d dgZdZdeZdZdgZdZ ddgZ dZ dZ ddk Z ddkZddkZddkZddkZddkZddkZddkZddkZddkZddkZyddklZWnddklZnXyddkZWn eZnXyddkZWn eZnXy6ddkZei i!eddk"l#Z$dZ%WndZ%hdZ$nXyddk&Z&ddk'Z'WneZ&Z'nXyddk(Z)WnnXyddk*Z*WnnXy3ddk+Z+eoddk,Z+de+i-_nWn eZ+nXyddk.l/Z/l0Z0Wnddk.Z.hZ/hZ0xje.i1i2D]Y\Z3Z4e4i5doe6e7e4dd!Z4ne8e4e/e3d&e:fd'YZ?ei@d(e _Aei@d)e _Bei@d*e _Ce iDiEd+iFdo#d,fd-YZGeGe _Dnhd.d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6d>d?6d@dA6dBdC6dDdE6dFdG6dHdI6dJdK6dLdM6dNdO6ZHy eIZJWn,eKj o ddPkJlJZJdQZInXdReJfdSYaLdTZMeaNdUZOhe6dVe6dW6e6dXe6dY6e6dZe6d[6e6d\e6d]6e6d^e6d_6e6d`e6da6e6dbe6dc6e6dde6de6e6dfe6dg6e6dhe6di6e6dje6dk6e6dle6dm6e6dne6do6e6dpe6dq6e6dre6ds6e6dte6du6e6dve6dw6e6dxe6dy6e6dze6d{6e6d|e6d}6e6d~e6d6e6de6d6e6de6d6e6de6d6e6de6d6e6de6d6e6de6d6ZPei@dZQdZRdfdYZSe%o&deSei iTiUfdYZVnde iWfdYZXdeSeXfdYZYdfdYZZdZ[deXfdYZ\dZ]deXfdYZ^dZ_dei`eiaeibfdYZcdZdgZedZfddddddddddddddd/gZggZhegD]eZieheiijddijddijddijddijddijddddddq`[hZk[igZlekD]Zmelei@eminq[lZo[mdZpefepdZqdZrdZsdZtdZuei@deqeresfZvei@deteufZwdZxefexdZyefeyei@dZzdZ{efe{hdd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6Z|hdd6dd6dd6dd6dd6dd6dd6Z}ei@dZ~dZefeh dd6dd6dd6dd6dd6dd6dd6dd 6d d 6d d 6dd6dd6Zei@dZdZefedZefedZhdd6dd6dd6dd6dd6Zeiieefed Zefed!Zd"Zd#Zd$Zeeeegd%Zd&fd'YZd(efd)YZd*efd+YZed,joDydd-klZWn eZnXeoGed.ed/d0Zeid1d2eid3d4d5d6d7d8d9d:eid;d<d=d5d>d7d?d9d@eidAdBd5dCd7dDd9dEeidFdGd5dHd7dId9dJeidKdLd5d1d7dMd9dNeidOdPdQdRd5dSdTed9dUei\ZZeio dZne oeieidnnOeid oeGHeidndVfdWYZeZeidZeMeieiid&eZxTeD]LZeedCeidHeid6eid>eiZeeieiq WndS(XsUUniversal feed parser Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds Visit http://feedparser.org/ for the latest version Visit http://feedparser.org/docs/ for the latest documentation Required: Python 2.1 or later Recommended: Python 2.3 or later Recommended: CJKCodecs and iconv_codec s4.2-pre-s$Revision: 314 $i is-svnsCopyright (c) 2002-2008, Mark Pilgrim, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.s'Mark Pilgrim s%Jason Diamond s'John Beimler s1Fazal Majid s"Aaron Swartz s(Kevin Marks s#Sam Ruby s(Ade Oshineye is.UniversalFeedParser/%s +http://feedparser.org/sapplication/atom+xml,application/rdf+xml,application/rss+xml,application/x-netcdf,application/xml;q=0.9,text/xml;q=0.2,*/*;q=0.1t drv_libxml2tuTidytmxTidyiiN(tStringIO(tescapecCsc|idd}|idd}|idd}x&|D]\}}|i||}q=W|S(Nt&s&t>s>t]|"[^"]*"(?=>|/|\s|\w+=)|'[^']*'(?=>|/|\s|\w+=))*(?=[<>])|.*?(?=[<>])icCs+|ii|||_|io|SdS(N(t endbrackettmatch(tselftstringtindex((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytsearchs cCs|ii|S(N(Rtend(Rtn((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytstarts(RRtretcompileRRR (((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRs tunknowntsRSS 0.90trss090sRSS 0.91 (Netscape)trss091nsRSS 0.91 (Userland)trss091usRSS 0.92trss092sRSS 0.93trss093sRSS 0.94trss094sRSS 2.0trss20sRSS 1.0trss10sRSS (unknown version)trsssAtom 0.1tatom01sAtom 0.2tatom02sAtom 0.3tatom03sAtom 1.0tatom10sAtom (unknown version)tatomtCDFtcdfsHot RSSthotrss(tUserDictcCs+h}x|D]\}}|||stlinksR]t enclosuretlicenseRJt categoriestscheme(R6t __getitem__thas_keytkeymaptgetttypettypestListType( RtkeytnorelR_R^t_[2]ttagtrealkeyR9((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRhs*   G ! :cCsoxY|iiD]H}||jo5|i|}t|tijo|d}qXqqWti|||S(Ni(RjtkeysRlRmRnR6t __setitem__(RRoRaR9((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRus  cCs!|i|o ||S|SdS(N(Ri(RRotdefault((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRks cCs&|i|p|||i?iiiiiiiiii`i:i#i@i'i=i"iiaibicidieifigihiiiiiiiiiijikiliminioipiqiriiiiiiii~isitiuiviwixiyiziiiiiiiiiiiiiiiiiiiiiii{iAiBiCiDiEiFiGiHiIiiiiiii}iJiKiLiMiNiOiPiQiRiiiiiii\iiSiTiUiViWiXiYiZiiiiiii0i1i2i3i4i5i6i7i8i9iiiiiiiR$i(iiiiii iiiiii i i iiiiiiiiiiiiiiiiiiiiiiii iiiiiiiiiiiiiiiiiiiiiiiiiii iiiiiiiiii[i.i<i(i+i!i&iiiiiiiiii]i$i*i)i;i^i-i/iiiiiiiii|i,i%i_i>i?iiiiiiiiii`i:i#i@i'i=i"iiaibicidieifigihiiiiiiiiiijikiliminioipiqiriiiiiiii~isitiuiviwixiyiziiiiiiiiiiiiiiiiiiiiiii{iAiBiCiDiEiFiGiHiIiiiiiii}iJiKiLiMiNiOiPiQiRiiiiiii\iiSiTiUiViWiXiYiZiiiiiii0i1i2i3i4i5i6i7i8i9iiiiii(t_ebcdic_to_ascii_mapRt maketranstjointmaptchrtranget translate(tstemapR((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt_ebcdic_to_ascii4s* :i ii iiii ii& ii ii! iiii0 ii`ii9 iiRii}ii ii ii ii ii" ii ii iiii"!iiaii: iiSii~iixis&^([A-Za-z][A-Za-z0-9+-.]*://)(/*)(.*?)cCs}tid|}yti||SWnPtig}ti|D]}|ti|qF~}ti||SXdS(Ns\1\3(t _urifixertsubturlparseturljoint urlunparseturllibtquote(tbaseturiR_tpart((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt_urljoinls <t_FeedParserMixinc Bs=eZh=dd6dd6dd6dd6dd6dd6dd6dd6dd6dd 6dd 6dd 6dd 6d d6dd6dd6dd6dd6dd6dd6dd6dd6dd 6d!d"6d#d$6d%d&6d'd(6d)d*6d+d,6d-d.6d/d06d1d26d3d46d5d66d5d76d8d96d:d;6d:d<6d=d>6d?d@6dAdB6dCdD6dEdF6dGdH6dIdJ6dKdL6dMdN6dOdP6dQdR6dSdT6dUdV6dWdX6dYdZ6d[d\6d]d^6d_d`6dadb6dcdd6dedf6dgdh6didj6ZhZdkdldmdndodpdqdrdsdtg Zddudvdwdxdydzd{d|g Zddudvdwdxdydzd{d|g Zd}d~gZddddZ dZ dZ dZ dZ ddZdZdZdZdZdZdZdZdZdZdZddZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$e$Z%dZ&dZ'dZ(e(Z)dZ*dZ+dZ,e,Z-dZ.e.Z/dZ0e0Z1e0Z2e0Z3e0Z4dZ5e5Z6e5Z7e5Z8e5Z9dZ:dZ;dZ<dZ=dZ>dZ?dZ@e@ZAdZBeBZCdZDdZEdZFdZGdZHeHZIeHZJdZKeKZLeKZMdZNeNZOdZPePZQdZRddZSdZTddZUdZVeVZWeVZXdZYeYZZeYZ[dZ\e\Z]e\Z^dZ_e_Z`e_ZadZbebZcebZddZeeeZfdZgegZhdZieiZjdZkekZldZmemZndZoeoZpeoZqdZrerZserZtdZueuZveuZweuZxeuZydZzezZ{ezZ|ezZ}ezZ~dZeZdZeZdZdZdZdZeZdZeZdZdZdZeZeZdZdZdZeZeZeZdZdZeZdZeZdZdZdZeZeZdZeZdZdZeZdZdZeZeZdZeZdZeZdZdZdZdZdZeZdZeZdZdZdZdZdZdZeZdZeZdZeZeZeZeZeZdZeZdZdZdZdZdZdZdZRS(R$shttp://backend.userland.com/rsss%http://blogs.law.harvard.edu/tech/rssshttp://purl.org/rss/1.0/s&http://my.netscape.com/rdf/simple/0.9/shttp://example.com/newformat#shttp://example.com/nechoshttp://purl.org/echo/suri/of/echo/namespace#shttp://purl.org/pie/shttp://purl.org/atom/ns#shttp://www.w3.org/2005/Atoms'http://purl.org/rss/1.0/modules/rss091#tadminshttp://webns.net/mvcb/tags,http://purl.org/rss/1.0/modules/aggregation/tannotates)http://purl.org/rss/1.0/modules/annotate/taudios!http://media.tangent.org/rss/1.0/t blogChannels-http://backend.userland.com/blogChannelModuletccshttp://web.resource.org/cc/tcreativeCommonss4http://backend.userland.com/creativeCommonsRssModuletcos'http://purl.org/rss/1.0/modules/companytcontents(http://purl.org/rss/1.0/modules/content/tcps&http://my.theinfo.org/changed/1.0/rss/tdcs http://purl.org/dc/elements/1.1/tdctermsshttp://purl.org/dc/terms/temails&http://purl.org/rss/1.0/modules/email/tevs&http://purl.org/rss/1.0/modules/event/t feedburners*http://rssnamespace.org/feedburner/ext/1.0tfmshttp://freshmeat.net/rss/fm/tfoafshttp://xmlns.com/foaf/0.1/tgeos(http://www.w3.org/2003/01/geo/wgs84_pos#ticbmshttp://postneo.com/icbm/timages&http://purl.org/rss/1.0/modules/image/tituness*http://www.itunes.com/DTDs/PodCast-1.0.dtds'http://example.com/DTDs/PodCast-1.0.dtdtls%http://purl.org/rss/1.0/modules/link/tmediashttp://search.yahoo.com/mrssshttp://search.yahoo.com/mrss/tpingbacks4http://madskills.com/public/xml/rss/module/pingback/tprisms.http://prismstandard.org/namespaces/1.2/basic/trdfs+http://www.w3.org/1999/02/22-rdf-syntax-ns#trdfss%http://www.w3.org/2000/01/rdf-schema#trefs*http://purl.org/rss/1.0/modules/reference/treqvs*http://purl.org/rss/1.0/modules/richequiv/Rs'http://purl.org/rss/1.0/modules/search/tslashs&http://purl.org/rss/1.0/modules/slash/tsoaps)http://schemas.xmlsoap.org/soap/envelope/tsss.http://purl.org/rss/1.0/modules/servicestatus/tstrs-http://hacks.benhammersley.com/rss/streaming/Rs-http://purl.org/rss/1.0/modules/subscription/tsys,http://purl.org/rss/1.0/modules/syndication/tszfs/http://schemas.pocketsoap.com/rss/myDescModule/ttaxos)http://purl.org/rss/1.0/modules/taxonomy/tthrs*http://purl.org/rss/1.0/modules/threading/ttis*http://purl.org/rss/1.0/modules/textinput/t trackbacks5http://madskills.com/public/xml/rss/module/trackback/twfws$http://wellformedweb.org/commentAPI/twikis%http://purl.org/rss/1.0/modules/wiki/txhtmlshttp://www.w3.org/1999/xhtmltxlinkshttp://www.w3.org/1999/xlinktxmls$http://www.w3.org/XML/1998/namespaceR^RAt wfw_commenttwfw_commentrsstdocsRKRJtcommentsticontlogottitleRHtinfoRVRGRSRRRIs text/htmlsapplication/xhtml+xmlsutf-8cCs|totiidn|ip7x4|iiD]\}}||i|iRiRR^RIR`RKRJtwidththeightt_start_(srelstype(sfeedsrsssrdf:RDF(s xhtml:divsdiv(stitleslinks descriptionsname(stitleslinks descriptionsurlshrefswidthR('RRRRRR;RkRRltunicodeRRRRRRRtappendRR~ttrackNamespaceRRRitendswithtfindtsplitRRt handle_datatstrattrsRRRtgetattrRytlentpusht _getContext(RRrtattrsR_R9R:RqtattrsDRRtprefixRt namespacetsuffixt methodnametmethodt unknown_tagtcontext((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytunknown_starttags3G %     !   = # '     cCsMtotiid|n|iddjo|idd\}}nd|}}|ii||}|o|d}n|djo|io|id8_nd||}y1|io t nt ||}|Wn$t j o|i ||nX|i oV|i id oC|i id d id  o#|djodSd |i d Ri(s xhtml:divsdiv(RRRRRRRRkRRyRtpopRRRiRRRRRR(RRrR R R R((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytunknown_endtag3sB   = #     c Cs|ipdS|i}|djod |}nJ|d d jot|dd}n t|}t|id}|iddi|dS(Nt34t38t39t60t62tx22tx26tx27tx3ctx3es&#%s;itxiisutf-8ii( RRRRRRRRRR(RRtinttunichrtencodeR(RRttexttc((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pythandle_charref[s    cCs|ipdStotiid|n|d jod|}n||iijo?|i|}|ido|id o|i |SnFy t |Wnt j od|}nXt t |i d }|id d i|dS(Ns"entering handle_entityref with %s tlttgttquottamptaposs&%s;s&#t;sutf-8ii(sltsgtR(R)R*(RRRRRR RtR~Rthandle_entityrefRR}R!R"R(RRR#((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR,is      icCs[|ipdS|o)|iiddjot|}n|iddi|dS(NRlsapplication/xhtml+xmlii(RRRkR R(RR#R((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRys   cCsdS(N((RR#((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pythandle_commentscCsdS(N((RR#((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt handle_piscCsdS(N((RR#((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt handle_declscCstotiidn|i||d!djoc|iid|}|djot|i}|S|it|i|d|!d|dS|iid|}|djo |d S|SdS( Nsentering parse_declaration i s iiiRi( RRRRtrawdataRRRR (RtiR9((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytparse_declarations $   cCsU|i}|djo d}n/|djo d}n|djo d}n|S(NR#s text/plainthtmls text/htmlRsapplication/xhtml+xml(R(Rt contentType((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytmapContentTypes       cCs|i}||fd jo|i o d|_n|djo|i o d|_n|djo|i o d|_n|iddjod }|}n|ii|o,|i||i|<||i|i|s
sR$tbase64s text/htmltmodeRRIRHRZR[RgtlabelR\txfnt relationshipsRJR`tvcardusutf-8s iso-8859-1RYRRaR^Rct_detailRG(scontents descriptionssummary(2RRRRRkRtstripR~RRR=t decodestringtbinasciitErrort Incompletetcan_be_relative_uriR7R9t lookslikehtmlR}R5t html_typestRESOLVE_RELATIVE_URIStcan_contain_relative_urist_resolveRelativeURIsRRt_parseMicroformatst_addTagt_start_enclosuret_addXFNRt SANITIZE_HTMLtcan_contain_dangerous_markupt _sanitizeHTMLRlRR"t_cp1252RtRRRR?RwtcopytdeepcopyRRR(RR8tstripWhitespaceR<tpiecestdepthtpiecetoutputt is_htmlisht mfresultsRrRdR@RBR_R$RR((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRs ,, , =   ! '2##,#)L    !           cCs|id7_|io|iidd|_nth|i|id|d6|id6|id6|_|i||i|id<|i ||dS(NiR{RRlRRR=( RRRR<R5RkRRt _isBase64R(RRrR tdefaultContentTypeR<((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt pushContentXs  cCs/|i|}|id8_|ii|S(Ni(RRRtclear(RRrRa((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt popContentbs cs|iidodS|iidddjodStid|ptid|pdStdtid|odSd d kl tfd tid |odSd S(NR2Rls text/htmls text/plainss&#?\w+;cSs|itijS((Rt_HTMLSanitizertacceptable_elements(R;((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRbtssR$R=iRlstext/is+xmls/xml(RkRR~R(RR R((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR`sc Cs|id|id|idd}|oPy |d=Wntj onXy |d=Wntj onX||ds<>t(iit)( RRkRR!RtgroupRRDRwR<(RRoRtdetailR`RRt emailmatch((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRsB  cCs|id|dddS(NRGs text/plaini(Rb(RR ((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt_start_subtitlescCs|iddS(NRG(Rd(R((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt _end_subtitlescCs|id|dddS(NRRs text/plaini(Rb(RR ((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt _start_rightsscCs|iddS(NRR(Rd(R((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt _end_rightsscCs|iit|iddd|_d|_d|_|i|d}|o|i}||d|i|}|ido|i|d|d'"]s&(?!#\d+;|#x[0-9a-fA-F]+;|\w+;)tareaRtbasefonttbrtcoltcommandtembedtframethrtimgtinputtisindextkeygenR^tmetatparamRttracktwbrcCsH||_||_totiid|intii|dS(Ns(entering BaseHTMLProcessor, encoding=%s ( RRlRRRRtsgmllibt SGMLParserR(RRRl((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRs   cCsg|_tii|dS(N(RZRgRhtreset(R((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRis cCsD|id}||ijo d|dSd|d|dSdS(NiRs />s>(RgRhtparse_starttagRlR0Rtlasttag(RR1tj((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRls (cCstidtiid|}tid|i|}|idd}|idd}|io/t|tdjo|i|i}nt i i ||t i i |dS( Ns\s]+?)\s*/>s't's"R:u( R!R"t IGNORECASERRkRRRlR"RgRhR=tclose(RR ((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR=s!#c Cs|p|Stg}|D]\}}||i|fq~i}g}|D]3\}}|||djo |ip|fqV~}|i|S(NR]Rl(srelstype(R;RR@tsort(RRR_R9R:Rq((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytnormalize_attrss ?G c Cstotiid|ng}d}|o-x|D]\}}|iddiddidd}|iid |}t|td jo3yt||i }Wqt|d }qXn|i t||i |fq9Wd i g}|D]\}}|d ||fq~}|i o$y|i |i }Wq[q[Xq_n||i jo|ii d tn|ii dtdS(Ns-_BaseHTMLProcessor, unknown_starttag, tag=%s R$Rs>Rs<R:s"s&us iso-8859-1u %s="%s"s<%(tag)s%(strattrs)s />s<%(tag)s%(strattrs)s>(RRRRRtbare_ampersandRRlRRRRR"RjRZtlocals(RRrRtuattrsRRoRaR_((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRs0 *#:  cCs/||ijo|iidtndS(Ns (RjRZRRu(RRr((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRscCs|idott|dd}ntt|}|tijo,|iidttt|dn|iidt dS(NRiis&#%s;s &#%(ref)s;( R~R!R RVRtRZRthextordRu(RRRa((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR%s ,cCsFti|o|iidtn|iidtdS(Ns &%(ref)s;s &%(ref)s(RRiRZRRu(RR((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR,scCs3totiid|n|ii|dS(Ns)_BaseHTMLProcessor, handle_data, text=%s (RRRRRZR(RR#((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRscCs|iidtdS(Ns(RZRRu(RR#((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR-scCs|iidtdS(Ns (RZRRu(RR#((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR. scCs|iidtdS(Ns (RZRRu(RR#((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR/ss-zA-Z][-_.a-zA-Z0-9:]*\s*cCs|i}t|}||jodS|i||}|oK|i}|i}|t||jodS|i|ifS|i|dSdS(Ni(Ni(Ni(Ni( R0RRt_new_declname_matchRRDRRR(RR1t declstartposR0RtmRR`((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt _scan_names      cCsd|S(Ns&#%s;((RR`((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytconvert_charref(scCsd|S(Ns&%s;((RR`((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytconvert_entityref+scCs1dig}|iD]}|t|q~S(s(Return processed HTML as a single stringR$(RRZR(RR_tp((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR].s(RRR!R"tspecialRtRjRRiRkRlR=RsRRR%R,RR-R.R/RRyR|R}R~R](((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRVs0               t_LooseFeedParsercBs#eZdZdZdZRS(cCsFtii|ti||||ti||d||_dS(Nsapplication/xhtml+xml(RgRhRRRVR (RRRRR ((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR3scCsm|idd}|idd}|idd}|idd}|idd}|idd}|id d }|id d }|id d }|idd }|idd}|idd}|iido~|iiddid o^|idd}|idd}|id d}|id d}|idd}n|S(Ns<s<s<s<s>s>s>s>s&s&s&s"s"s"s's's'RlRRRRR:Ro(RRRiRkR(RR8R ((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR99s&3c CsDdig}|D])\}}|d||iddfq~S(NR$s %s="%s"R:s"(RR(RRR_RR:((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRNs(RRRR9R(((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR2s  t_MicroformatsParserc!BsXeZdZdZdZdZdZddddd d d d d ddddddddddddddddgZddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d%d/dd0d1d2d3d4d5d6d7d8d9d:d;d<g!Zd=Z d>Z d?Z d@Z dAZ dBZddCdCdDZdCdEZdFZdGZdHZdIZRS(Jiiiiitcontactt acquaintancetfriendtmets co-workertcoworkert colleagues co-residentt coresidenttneighbortchildtparenttsiblingtbrothertsistertspousetwifethusbandtkintrelativetmusetcrushRDt sweethearttmetziptrartexetgzttarttgzttbz2tbz2tzt7ztdmgR_tsittsitxthqxtdebtrpmtjartisotbintmsitmp2tmp3toggtogmtmp4tm4vtm4atavitwmatwmvcCsxti||_||_||_t|tdjo|i|}ng|_g|_g|_d|_ dS(Nu( t BeautifulSouptdocumentRRRlR"RZR\R@RRB(RR RR((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR[s     cCsWt|tdtdfjo.|iddiddidd}n|S( NR$ut,s\,R+s\;s s\n(RlR(RR((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt vcardEscapefs%.cCstidd|}d}d}d}xDt||jo0|||| d7}||}d}d}q*W|||7}|S(Ns;+$R$iKs t iJ(R!RR(RRtsFoldedtiMaxtsPrefix((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt vcardFoldks  cCstidd|iS(Ns\s+R(R!RRD(RR((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt normalizexscCs9g}x,|D]$}||jo|i|q q W|S(N(R(RR7tresultsR8((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytunique{s  cCstid|S(Ns%Y-%m-%dT%H:%M:%SZ(ttimetstrftime(Rtdt((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt toISO8601sic Csxd}|i}d}d}htid|d6} |oe||ijoUg} |ddg| } x!| D]} | i| dqtWt| dj}n|p%||| } t| dj}n| o\|d joO|d } t| dj}| }|p|g} t| dj}q7ng} |d joH||| }x6|D]*}|i|| o| i|q`q`Wng}x,| D]$}|| jo|i|qqWt|dj}|ph|ogS||ijod S||i jodS||i jod S||ijodSdSng}x#|D]}d}||ijo#|o|i|qUq|Sn|i i}||i joC|d jo6|idpd idiidd}n|o'|o|i|p |i}n| o |djo|id}n|o'|o|i|p |i}n| ot||i jod|d jo|id}q|djo|id}q|djo|id}qn|o'|o|i|p |i}n| o |djo|id}n|o'|o|i|p |i}n|pI|i}tidd |}|idd}|idd}n|o'|o|i|p |i}n|pqUn||i jot|}n|o(|i|o|i|p|qU|o|i|p|SqUW|S(NcSsdS(i((R((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRbsiis\b%s\btclasstultoltliRatpreRBR$taRJsmailto:t?tabbrRR_RtobjectR talts <\S[^>]*>s s s (RR!R"tNODEtextendRt findParentRtSTRINGtDATERtURIR`tEMAILRkRRRRDtrenderContentsRRt_parse_date_iso8601R(RtelmRoott sPropertyt iPropertyTypetbAllowMultiplet bAutoEscapetalltbFoundt bNormalizet propertyMatcht snapResultst containerst containertarFiltert snapFiltertnodet arResultstarValuest elmResulttsValuet sNodeName((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytgetPropertyValues       6''   '' '(c(s d}|pi|ddd}n |g}x|D]gfd}fd}dfd}iddd}x|D]} tid i| id ovi| dd } | id d } | id d} | oii d| nd| d id?}!|!obi|!d@i d d}"i|!dAi d d}#ii dB|"d |#n|dC|dD|dEidF}$|$oi|$dGi d d}%|%pGidFi d d}%|%oii dH|%qq i|$dIi dd}&ii dH|%d d i |&nidJi ddidKi dd}'|'o'ii dLdi |'n|dM|dN|dO|dP|dQ|d |dRo2dSdTgdUg|d i d 7}q9q9W|iS(VNR$RBRicsXi|idd}|o(ii|id|n|pdS(NRiRR$(RRRRtupper(RR(telmCardRtarLines(sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytprocessSingleStrings(cs\i|i}|o9d}d}d}|idoDd}|iddidi}|iddi}nbi|}|oH|d jo d }n|id diidii}n|i}|d jo d}n|od |i}nii |i|||d|ndS(NR$sdata:s ;ENCODING=bR+it/RiRKs ;VALUE=uriRls OCTET-STREAMs;TYPE=R( RRR~RRRkRDRRR(RRt sContentTypet sEncodingt sValueKeytelmValue(RRR(sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytprocessSingleURIs("  1   csi|dd}x|D]}i|didd}|oi||}n|p |}ni|did}|o9ii|iddi|d|qqWdS( NRiRlRais;TYPE=RR(RRRRRRRR(Rt arDefaultTypet arForceTypeRRtarTypeR(RRR(sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytprocessTypeValues tagents \bvcard\bRs s\nR+s\;sAGENT:RaRsAGENT;VALUE=uri:tfnRs family-names given-namesadditional-namesadditional-namesshonorific-prefixshonorific-prefixesshonorific-suffixshonorific-suffixessN:Riit.s sort-strings SORT-STRING:tnicknames NICKNAME:tphototbdaysBDAY:tadrRltintltpostaltparceltworkspost-office-boxsextended-addresssstreet-addresstlocalitytregions postal-codes country-names ADR;TYPE=RR?tteltvoiceRtinternettmailerttzRtlatitudet longitudesGEO:RtroleRtorgsorganization-namesORG:sorganization-unitRYRfs CATEGORIES:tnotetrevtsoundtuidRKRos BEGIN:vCards VERSION:3.0s END:vCard(RRR!R"RRkt findVCardsRRRtcontentsRRRRRRRRRRD((RRt bAgentParsingtsVCardstarCardsRRRtarAgenttelmAgentt sAgentValuetsFNtelmNamet sFamilyNamet sGivenNametarAdditionalNamestarHonorificPrefixestarHonorificSuffixestarNamestbFamilyNameFirstt sSortStringt arNicknametdtBdaytarAdrtelmAdrRtsPostOfficeBoxtsExtendedAddresstsStreetAddresst sLocalitytsRegiont sPostalCodet sCountryNametelmGeot sLatitudet sLongitudetelmOrgtsOrganizationNametarOrganizationUnitt arCategory((RRRsE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRs "  " ::: 5*.2' ' D  &   "/:'       cCs|i}|idpdS|iddi}|idp1|idp!|ido|id od Sti|dd }|id d jodS|id i i }||i jS( NRJiRlR$saudio/svideo/s application/RiiRi( tattrMapRiRkRDR~RRRRRRtknown_binary_extensions(RtelmR tlinktypetpathtfileext((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytisProbablyDownloadables !c Cs3d}x#|i|htidd6D]}|id}|pq,ntit|i|\}}}}}} |id} | i} | p| i} nti ||di | dddf} | i dp| d7} n|i i th| d6| d6|ipdd 6q,WdS( NcSsdS(i((R((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRbss\btag\bR]RJRR$R[RgR?(RR!R"RkRRRRRRRRRZRR<R( RRR=RJt urlschemeRR?tparamstquerytfragmenttsegmentsRrt tagscheme((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytfindTagss #- *cCsd}tid}x|i|htidd6D]}|i|idd o|i| oq;n|i|ijoJ|ii|i|i o)|id o|i |iddd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbgcZddcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}dd~dddddddddddddddddddddddd&ddddddddddddddddd5ddddddddddddddddddddddddddddddddddddddddddddOdddddddddddddddddddddddgZdddgZdddddddddddddddd%dddddddddddddddddddd d d d d ddddddg.Zdddddddddddddddd d!d"d#d$d%d&d'd(d)dd*d+d,d-d.d/d0d1d2d3d4d5d6g'Zeid7d8Z d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUd'dVgZ dWdgdXdXdXdYdZd[d\d]dd^d_d`dadbdcdddddedfdgdhdididjdkddldmdmdmdndoddpdqdrdsdtdudddvdwdxdydzg1Z dd{d|d}d~ddddddddddddddddddddddddddddddg#Z ddddddddddddddd~ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddvddwddxd dd dydzd d d dgZ dZdZddddddddgZdZdZdZdZdZdZdZRS(RRtacronymtaddressRWtarticletasideRtbtbigRTRYtbuttontcanvastcaptiontcenterRUtcodeRZtcolgroupR[tdatagridtdatalisttddRXtdetailstdfntdialogtdirRtdlRtems event-sourcetfieldsettfiguretfootertfontRYtheaderth1th2th3th4th5th6R^R1R_R`R`RbtkbdR?tlegendRR{RtmenutmetertmulticoltnavtnextidRR]toptgrouptoptionRRtprogressRbRtsamptsectiontselecttsmallRRtspacertspantstriketstrongRtsupttablettbodyttdttextareaRttfoottthttheadttrttttuRtvartvideotnoscripttacceptsaccept-charsett accesskeyRZtalignRt autocompletet autofocustaxisRWtbalancetbgcolort bgpropertiestbordert bordercolortbordercolordarktbordercolorlightt bottompaddingt cellpaddingt cellspacingtcht challengeR tcharofftchofftcharsettcheckedRRctcolortcolstcolspantcompacttcontenteditabletcontrolstcoordsR tdatafldt datapagesizetdatasrctdatetimeRvtdelaytdisabledt draggabletdynsrctenctypeRtfacetforR]t galleryimgtguttertheadersRt hidefocusthiddenthighRJthreflangthspaceRRAt inputmodetismaptkeytypet leftspacingRtlistR[tloopt loopcounttloopendt loopstarttlowtlowsrctmaxt maxlengthRRtmintmultipleR`tnohreftnoshadetnowraptopentoptimumtpatterntpings point-sizetprompttpqgt radiogrouptreadonlyR]s repeat-maxs repeat-minRtrequiredRt rightspacingtrowstrowspantrulestscopetselectedtshapetsizeRR tstepRHtsuppressttabindexttargetttemplateRt toppaddingRlt unselectableR_turntvalignRatvariabletvolumetvspacetvrmlRtwrapsxml:langRcRRtstyletazimuthsbackground-colorsborder-bottom-colorsborder-collapses border-colorsborder-left-colorsborder-right-colorsborder-top-colortcursort directiontdisplayt elevationtfloats font-familys font-sizes font-styles font-variants font-weightsletter-spacings line-heighttoverflowtpauses pause-afters pause-beforetpitchs pitch-rangetrichnesstspeaks speak-headers speak-numeralsspeak-punctuations speech-ratetstresss text-alignstext-decorations text-indents unicode-bidisvertical-aligns voice-familys white-spacetautotaquatblacktblocktbluetboldtbothtbottomtbrowntcollapsetdashedtdottedtfuchsiatgraytgreens !importanttitalictlefttlimetmaroontmediumtnonetnavytnormaltolivetpointertpurpletredtrighttsolidtsilverttealttopt transparentt underlinetwhitetyellows(^(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|s4\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$t annotationsannotation-xmltmactionRtmerrortmfencedtmfractmit mmultiscriptstmntmotmovertmpaddedtmphantomt mprescriptstmroottmrowtmspacetmsqrttmstyletmsubtmsubsuptmsuptmtabletmtdtmtexttmtrtmundert munderovert semanticst actiontypet columnalignRqt columnlinest columnspacingt columnspanR[t displaystyleRt equalcolumnst equalrowstfencet fontstylet fontweightt linethicknesstlspacetmathbackgroundt mathcolort mathvarianttmaxsizetminsizetothertrowaligntrowlinest rowspacingtrspacet scriptlevelt selectiont separatort separatorststretchys xlink:hrefs xlink:shows xlink:typeRs xmlns:xlinktanimatet animateColort animateMotiontanimateTransformtcircletdefstdesctellipset foreignObjects font-facesfont-face-names font-face-srctgtglyphthkerntlinearGradienttlinetmarkertmetadatas missing-glyphtmpathR?tpolygontpolylinetradialGradienttrecttsettstopRtswitchR#ttspantuses accent-heightt accumulatetadditivet alphabetics arabic-formtascentt attributeNamet attributeTypet baseProfiletbboxtbegintbytcalcModes cap-heightscolor-renderingRtcxtcytdtdxtdytdescenttdurtfills fill-opacitys fill-rules font-stretchtfromtfxtfytg1tg2s glyph-namet gradientUnitsthangings horiz-adv-xshoriz-origin-xt ideographicR9t keyPointst keySplinestkeyTimest mathematicals marker-ends marker-mids marker-startt markerHeightt markerUnitst markerWidthtoffsettopacitytorienttoriginsoverline-positionsoverline-thicknessspanose-1t pathLengthtpointstpreserveAspectRatiotrtrefXtrefYt repeatCountt repeatDurtrequiredExtensionstrequiredFeaturestrestarttrotatetrxtrytslopetstemhtstemvs stop-colors stop-opacitysstrikethrough-positionsstrikethrough-thicknesststrokesstroke-dasharraysstroke-dashoffsetsstroke-linecapsstroke-linejoinsstroke-miterlimitsstroke-opacitys stroke-widthtsystemLanguages text-anchorttot transformtu1tu2sunderline-positionsunderline-thicknessRs unicode-ranges units-per-emtvaluesRtviewBoxt visibilitytwidthsRsx-heighttx1tx2s xlink:actuates xlink:arcroles xlink:roles xlink:titlesxml:bases xml:spacetyty1ty2t zoomAndPancCs,ti|d|_d|_d|_dS(Ni(RVRitunacceptablestacktmathmlOKR(R((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRi s   cCs|i}h}||ijp |io||ijo|id7_n|iidot|djo+t|idp|i d qn|djo+t|idp|i d qqn|djo d|jo|i d7_ n|djo d|jo|id7_n|i o||i jo |i }q|io||i jou|ip@g}|iD]}||iq~}g}|iD]} | |jo || qq~} ||_tg} | D]} | | i| fq~ |_g} |i D]}| |iq$~ }g} |i D]} | |jo | | qNqN~ } ||_ tg}| D]} || i| fq~|_n|i}|ii||}|i}q||ijodSn|i p |io9td|o"d|jo|i dqEqIng}x|i|D]\}}||jo)|i||}|i ||fq_|d jo1|i|}|o|i ||fqq_q_Wti|||dS(NiR3RRshttp://www.w3.org/2000/svgRs"http://www.w3.org/1998/Math/MathMLcSs|\}}|idS(sxlink:(R~(t.0RR:((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRb ss xmlns:xlinkshttp://www.w3.org/1999/xlinkR(sxmlnsshttp://www.w3.org/2000/svg(sxmlnss"http://www.w3.org/1998/Math/MathML(sxmlnss"http://www.w3.org/1998/Math/MathML(sxmlnsshttp://www.w3.org/2000/svg(s xmlns:xlinkshttp://www.w3.org/1999/xlink(s xmlns:xlinkshttp://www.w3.org/1999/xlink(tacceptable_attributesRfRt"unacceptable_elements_with_end_tagRRlRR;RkRRtmathml_elementstmathml_attributest svg_elementst svg_attr_maptsvg_attributesRt svg_elem_mapRiRstsanitize_styleRVR(RRrRRRjR_tattrRRqRtmixt_[3]t_[4]t_[5]t_[6]t clean_attrsRoRat clean_value((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR s`     *5 6*5 :       cCs||ijo||ijo|id8_n|io>||ijo.|djo|io|id8_qq|ioS||ijoC|ii||}|djo|io|id8_qqdSnt i ||dS(NiRR( RfRRRRRRRRkRVR(RRr((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR scCsdS(N((RR#((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR. scCsdS(N((RR#((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR/ scCs"|ipti||ndS(N(RRVR(RR#((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR s cCstidid|}tid|pdStidd|iodSg}xtid|D]\}}|pqmn|i|ijo|i|d|dqm|i d d idjo]x|i D]/}||i jo|i i| oPqqW|i|d|dqm|i o3|i|i jo|i|d|dqmqmWdi|S(Nsurl\s*\(\s*[^\s)]+?\s*\)\s*Rs@^([:,;#%.\sa-zA-Z0-9!]|\w-\w|'[\s\w]+'|"[\s\w]+"|\([\d,\s]+\))*$R$s\s*[-\w]+\s*:\s*[^:;]*;?s([-\w]+)\s*:\s*([^:;]*)s: R+RiRWRtmargintpadding(s backgroundRsmarginR(R!R"RRRDRjRtacceptable_css_propertiesRRtacceptable_css_keywordstvalid_css_valuesRtacceptable_svg_propertiesR(RRtcleantpropRatkeyword((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR s,     !N(RRRfRRRRR!R"RRRRRRRRRRiRRR.R/RR(((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRe s!                            <   c st||}|i||i}tod}x~tD]v}yf|djo$ddklfd}Pn2|djo$ddkl fd}PnWq<q<Xq<W|o|||dj}|o|i d }n||d d d d d ddd}|ot |d }n|i doD|i dd d }|i do|i dd d }qn|i do|i dd d}qqn|iidd}|S(NRi(t parseStringcst||S(N(R(R tkwargs(t_utidy(sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt_tidy sR(tTidycs"i||\}}}}|S(N(ttidy(R Rtnerrorst nwarningst errordata(t_mxtidy(sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR susutf-8t output_xhtmlitnumeric_entitiesRit char_encodingtutf8seZdZdZdZeZeZeZdZRS(cCs`|ddjo'|djo|i|||||Sti|||i}||_|S(Nidii0(thttp_error_302Rt addinfourlt get_full_urltstatus(RtreqtfpRotmsgRtinfourl((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pythttp_error_default5 s  cCst|iido%tii||||||}nti|||i}t|dp ||_ n|S(NtlocationR( R;Riturllib2tHTTPRedirectHandlerRRRRRxR(RRRRoRRR((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR< s % cCst|iido%tii||||||}nti|||i}t|dp ||_ n|S(NR R( R;RiR R thttp_error_301RRRRxR(RRRRoRRR((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR E s % c Csti|id}ytiiddjpttdjptti|i diddid\}}t i d|dd} |i | ||||i d |||} |i| SWn|i|||||SXdS( Niis2.3.3t AuthorizationRRsrealm="([^"]*)"sWWW-Authenticateswww-authenticate(RRRRRRR=RRERR!Rjt add_passwordthttp_error_auth_reqedtreset_retry_countR ( RRRRoRRthosttusertpasswtrealmtretry((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pythttp_error_401R s !2 ( RRR RR thttp_error_300thttp_error_303thttp_error_307R(((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR4 s  cCsst|do|S|djotiSti|dd3jo|p t}nd2}toti|\}}ti |\} }| oLti | \} } | o,d|| |f}ti | i }qqny?t |to|id}n|id id}WnnXti|} | id ||o| id |nt|td jot|}n|od ddddddg} ddddddddddddg } | id d!| |d"|d#| |d$d$|d|d%|d&|d'fn|o| id(|ntoto| id)d*nGto| id)d+n,to| id)d,n| id)d |o| id-d.|nto| id/tn| id0d1ttittg|}g|_z|i| SWd2|iXnyt|SWnnXt t!|S(4sURL, filename, or string --> stream This function lets you define parsers that take any input source (URL, pathname to local or network file, or actual data as a string) and deal with it in a uniform manner. Returned object is guaranteed to have all the basic stdio read methods (read, readline, readlines). Just .close() the object when you're done with it. If the etag argument is supplied, it will be used as the value of an If-None-Match request header. If the modified argument is supplied, it can be a tuple of 9 integers (as returned by gmtime() in the standard Python time module) or a date string in any format supported by feedparser. Regardless, it MUST be in GMT (Greenwich Mean Time). It will be reformatted into an RFC 1123-compliant date and used as the value of an If-Modified-Since request header. If the agent argument is supplied, it will be used as the value of a User-Agent request header. If the referrer argument is supplied, it will be used as the value of a Referer[sic] request header. If handlers is supplied, it is a list of handlers used to build a urllib2 opener. treadRithttpthttpstftps %s://%s%stidnasutf-8s User-Agents If-None-MatchR$tMontTuetWedtThutFritSattSuntJantFebtMartAprtMaytJuntJultAugtSeptOcttNovtDecsIf-Modified-Sinces#%s, %02d %s %04d %02d:%02d:%02d GMTiiiiiitReferersAccept-encodings gzip, deflatetgziptdeflateRsBasic %stAcceptsA-IMR=N(shttpshttpssftp("RxRtstdinRt USER_AGENTRR=Rt splittypet splithostt splitusert encodestringRDt isinstanceRR"tdecodeR tRequestt add_headerRlRR4tzlibt ACCEPT_HEADERtapplyt build_openerttupleRt addheadersRRqt _StringIOR(turl_file_stream_or_stringtetagRLRtreferrerthandlerstauthturltypetresttrealhostt user_passwdtrequesttshort_weekdaystmonthstopener((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt_open_resourcej sp  !*U" cCstid|dS(sLRegister a date handler function (takes string, returns 9-tuple date in GMT)iN(t_date_handlerstinsert(tfunc((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pytregisterDateHandler ss YYYY-?MM-?DDs YYYY-0MM?-?DDsYYYY-MMs YYYY-?OOOs YY-?MM-?DDsYY-?OOOtYYYYs-YY-?MMs-OOOs-YYs--MM-?DDs--MMs---DDtCCs(?P\d{4})tYYs(?P\d\d)tMMs(?P[01]\d)tDDs(?P[0123]\d)tOOOs(?P[0123]\d\d)s(?P\d\d$)s$(T?(?P\d{2}):(?P\d{2})s(:(?P\d{2}))?s(\.(?P\d+))?s6(?P[+-](?P\d{2})(:(?P\d{2}))?|Z)?)?c Csd}x&tD]}||}|oPq q W|pdS|idjodS|i}|idd}|ot|}nd}|idd}| p |djotid}nLt|djo,dttiddt|}n t|}|idd }| p |d jo%|o d }q`tid }nt|}|id d}|ph|o |}q|id dp&|iddp|iddo d }qtid}n t|}d |i jo t|d d dd }nx>d ddddgD]'}|i|dpd||(\d{4})-(\d{2})-(\d{2})\s+(%s|%s)\s+(\d{,2}):(\d{,2}):(\d{,2})cCsti|}|pdSdh|idd6|idd6|idd6|id d 6|id d 6|id d6dd6}totiid|nt|S(s8Parse a string according to the OnBlog 8-bit date formatNsE%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s:%(second)s%(zonediff)siRaiRbiRciReiRfiRgs+09:00tzonediffsOnBlog date parsed as: %s (t_korean_onblog_date_reRRRRRRt_parse_date_w3dtf(RqR{t w3dtfdate((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt_parse_date_onblogO s30 cCsti|}|pdSt|id}|id}|tjo|d7}nt|}t|djod|}ndh|idd6|id d 6|id d 6|d 6|idd6|idd6dd6}toti i d|nt |S(s6Parse a string according to the Nate 8-bit date formatNiii it0sE%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s:%(second)s%(zonediff)sRaiRbiRcReiRfiRgs+09:00RwsNate date parsed as: %s ( t_korean_nate_date_reRR Rt _korean_pmRRRRRRRy(RqR{RetampmRz((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt_parse_date_nate[ s"  3' s9(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})(\.\d+)?cCsti|}|pdSdh|idd6|idd6|idd6|id d 6|id d 6|id d6dd6}totiid|nt|S(s2Parse a string according to the MS SQL date formatNsE%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s:%(second)s%(zonediff)siRaiRbiRciReiRfiRgs+09:00RwsMS SQL date parsed as: %s (t_mssql_date_reRRRRRRRy(RqR{Rz((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt_parse_date_mssqlp s30 uJanuΙανuFebuΦεβuMaruΜάώuΜαώuApruΑπρuMayuΜάιuΜαϊuΜαιuJunuΙούνuΙονuJuluΙούλuΙολuAuguΑύγuΑυγuSepuΣεπuOctuΟκτuNovuΝοέuΝοεuDecuΔεκuSunuΚυρuMonuΔευuTueuΤριuWeduΤετuThuuΠεμuFriuΠαρuSatuΣαβuL([^,]+),\s+(\d{2})\s+([^\s]+)\s+(\d{4})\s+(\d{2}):(\d{2}):(\d{2})\s+([^\s]+)cCsti|}|pdSy*t|id}t|id}WndSXdh|d6|idd6|d6|id d 6|id d 6|id d6|idd6|idd6}totiid|nt |S(s6Parse a string according to a Greek 8-bit date format.NiisP%(wday)s, %(day)s %(month)s %(year)s %(hour)s:%(minute)s:%(second)s %(zonediff)stwdayiRcRbiRaiReiRfiRgiRwsGreek date parsed as: %s ( t_greek_date_format_reRt _greek_wdaysRt _greek_monthsRRRRt_parse_date_rfc822(RqR{RRbt rfc822date((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt_parse_date_greek s10u01ujanuáru02u februáriu03umárciusu04uáprilisu05umáujusu06ujúniusu07ujúliusu08u augusztusu09u szeptemberu10uoktóberu11unovemberu12udecemberu?(\d{4})-([^-]+)-(\d{,2})T(\d{,2}):(\d{2})((\+|-)(\d{,2}:\d{2}))cCsti|}|pdSywt|id}|id}t|djod|}n|id}t|djod|}nWndSXdh|idd6|d 6|d 6|d 6|id d 6|idd6}totiid|nt |S(s:Parse a string according to a Hungarian 8-bit date format.NiiiR|is:%(year)s-%(month)s-%(day)sT%(hour)s:%(minute)s%(zonediff)sRaRbRcReiRfiRwsHungarian date parsed as: %s ( t_hungarian_date_format_reRt_hungarian_monthsRRRRRRRy(RqR{RbRcReRz((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt_parse_date_hungarian s(!c Csd}d}d}d}d}ti|}d|}d||f}ti|} | i|} | djp| i|jodS|| || d } | ddjodStiti| || tiS( Nc Sst|id}|djo,dttiddt|}n|djod S|id}|ot|}|dd}|dd}d}x||joti|||ddddddf }ti|d}t||}||jo/||jo||}qw|d}d }q||jo-||d jo||}qw|d}qqW|||fS|id }d}|djo d}n9t|}|id }|ot|}nd}|||fS(NRaidiitjulianiiiiiRbRc(iii(R RRRnRRptabs(R{RaRRbRctjdayR;tdiff((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt__extract_date sH ,   *        cSs|pdS|id}|pdSt|}t|id}|id}|ot|}nd}|||fS(Nithourstminutestseconds(iii(iii(RR (R{RRR((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt__extract_time s cSs|pdS|id}|pdS|djodSt|id}|id}|ot|}nd}|d|d}|ddjo| S|S(sAReturn the Time Zone Designator as an offset in seconds from UTC.ittzdRjttzdhourst tzdminutesi<Rk(RR (R{RRRR((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt __extract_tzd s  sd(?P\d\d\d\d)(?:(?P-|)(?:(?P\d\d\d)|(?P\d\d)(?:(?P=dsep)(?P\d\d))?))?s;(?P[-+](?P\d\d)(?::?(?P\d\d))|Z)sW(?P\d\d)(?P:|)(?P\d\d)(?:(?P=tsep)(?P\d\d(?:[.,]\d+)?))?s %s(?:T%s)?i(iii( R!R"RRRRRnRpttimezone( RqRRRt __date_ret__tzd_ret__tzd_rxt __time_ret __datetime_ret __datetime_rxR{tgmt((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRy s" )   cCs|i}|dddjp|ditijo |d=nt|djof|d}|id}|djo || ||dg|d)n|id d i|}nt|d jo|d 7}nti|}|ot i ti |Sd S(s8Parse an RFC822, RFC1123, RFC2822, or asctime-style dateiiRRiiRkiR$Ris 00:00:00 GMTN(RR( RRtrfc822t _daynamesRRRRt parsedate_tzRRnt mktime_tz(RqR RR1Rv((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR@ s /     iptATi tETitCTiDtMTitPTc Cstid}|i|i\}}}}}}}} dddddddd d d d d g } d||| t|d||||| f} ti| } | otiti | SdS(s.parse a date in yyyy/mm/dd hh:mm:ss TTT formatsE(\w{,3}), (\d{,4})/(\d{,2})/(\d{2}) (\d{,2}):(\d{2}):(\d{2}) (\w{,3})R'R(R)R*R+R,R-R.R/R0R1R2s%s, %s %s %s %s:%s:%s %siN( R!R"RtgroupsR RRRRnR( t aDateStringt_my_date_patterntdowRaRbRcReRfRgRRSRqRv((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt_parse_date_perforceX s -*0cCsxtD]}yg||}|pwnt|djo%totiidntntt||SWqt j o7}to'tiid|i t |fqqXqWdS(s6Parses a variety of date formats into a 9-tuple in GMTi s*date handler function must return 9-tuple s %s raised %s N( RVRRRRRt ValueErrorRR t ExceptionRRR(RqRBt date9tupleRh((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRg s"   ' c Csd}d}d}d}||id\}}yj|d djot|}n.|d djo"d}t|did}nt|djoK|d d jo:|d d!d jo&d}t|d did}n|d d jo"d }t|d id}njt|djoK|d djo:|d d!d jo&d }t|d d id}n |d djo"d}t|did}n|d djo"d}t|did}n|d djo&d}t|ddid}no|d djo&d}t|ddid}n8|d djo&d}t|ddid}ntidi|}Wn d2}nX|o8|i di }|o|d3jo |}qnd} d4} d5} || jp |i d*o.|i d+od,} |p |pd}n|| jp |i d-o'|i d+od,} |pd.}nX|i d-o|pd.}n7|o"|i d o|pd/}n|pd}|i d0jo d1}n||||| fS(6s Get the character encoding of the XML document http_headers is a dictionary xml_data is a raw string (not Unicode) This is so much trickier than it sounds, it's not even funny. According to RFC 3023 ('XML Media Types'), if the HTTP Content-Type is application/xml, application/*+xml, application/xml-external-parsed-entity, or application/xml-dtd, the encoding given in the charset parameter of the HTTP Content-Type takes precedence over the encoding given in the XML prefix within the document, and defaults to 'utf-8' if neither are specified. But, if the HTTP Content-Type is text/xml, text/*+xml, or text/xml-external-parsed-entity, the encoding given in the XML prefix within the document is ALWAYS IGNORED and only the encoding given in the charset parameter of the HTTP Content-Type header should be respected, and it defaults to 'us-ascii' if not specified. Furthermore, discussion on the atom-syntax mailing list with the author of RFC 3023 leads me to the conclusion that any document served with a Content-Type of text/* and no charset parameter must be treated as us-ascii. (We now do this.) And also that it must always be flagged as non-well-formed. (We now do this too.) If Content-Type is unspecified (input was local file or non-HTTP source) or unrecognized (server just got it totally wrong), then go by the encoding given in the XML prefix of the document and default to 'iso-8859-1' as per the HTTP specification (RFC 2616). Then, assuming we didn't find a character encoding in the HTTP headers (and the HTTP Content-type allowed us to look in the body), we need to sniff the first few bytes of the XML data and try to determine whether the encoding is ASCII-compatible. Section F of the XML specification shows the way here: http://www.w3.org/TR/REC-xml/#sec-guessing-no-ext-info If the sniffed encoding is not ASCII-compatible, we need to make it ASCII compatible so that we can sniff further into the XML declaration to find the encoding attribute, which will tell us the true encoding. Of course, none of this guarantees that we will be able to parse the feed in the declared character encoding (assuming it was declared correctly, which many are not). CJKCodecs and iconv_codec help a lot; you should definitely install them if you can. http://cjkpython.i18n.org/ cSsD|pd}ti|\}}||iddiddfS(s takes HTTP Content-Type header and returns (content type, charset) If no charset is specified, returns (content type, '') If no content type is specified, returns ('', '') Both return parameters are guaranteed to be lowercase strings R$RRo(tcgit parse_headerRkR(t content_typeRC((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt_parseHTTPContentType s R$s content-typeisLot<?sutf-16besutf-8ists<?sutf-16lestisiso-10646-ucs-2sucs-2t csunicodesiso-10646-ucs-4sucs-4tcsucs4sutf-16sutf-32tutf_16tutf_32tutf16tu16sapplication/xmlsapplication/xml-dtds&application/xml-external-parsed-entitystext/xmlstext/xml-external-parsed-entitys application/s+xmlistext/sus-asciis iso-8859-1tgb2312tgb18030N( siso-10646-ucs-2sucs-2Rsiso-10646-ucs-4sucs-4Rsutf-16sutf-32sutf_16sutf_32sutf16su16(sapplication/xmlsapplication/xml-dtds&application/xml-external-parsed-entity(stext/xmlstext/xml-external-parsed-entity(RkRRR"RR!R"RRRRR~RRi( t http_headerstxml_dataRtsniffed_xml_encodingt xml_encodingt true_encodingthttp_content_typet http_encodingtxml_encoding_matchtacceptable_content_typetapplication_content_typesttext_content_types((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt_getCharacterEncodingw sz0 8 8           c Cstotiid|nt|djou|d djod|dd!djoPto5tiid|djotiidqnd}|d}nt|djou|d d jod|dd!djoPto5tiid|d jotiid qnd }|d}n$|d d joPto5tiid|djotiidq|nd}|d }n|d djoPto5tiid|djotiidqnd}|d}nb|d djoPto5tiid|djotiidq>nd}|d}nt||}totiid|ntid}d}|i|o|i ||}n|d|}|i dS(sChanges an XML data stream on the fly to specify a new encoding data is a raw sequence of bytes (not Unicode) that is presumed to be in %encoding already encoding is a string recognized by encodings.aliases s%entering _toUTF8, trying encoding %s iisRsstripping BOM sutf-16bestrying utf-16be instead ssutf-16lestrying utf-16le instead issutf-8strying utf-8 instead Rsutf-32bestrying utf-32be instead ssutf-32lestrying utf-32le instead s*successfully converted %s data to unicode s^<\?xml[^>]*?>s&u ( RRRRRRR!R"RRR"(R Rtnewdatat declmatchtnewdecl((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt_toUTF8 s\8 8    c stid|}|o |ipd}||d ||d}}tidti}|i|}|id|}tidti}|i|}|o |dpd}|iido d }nd}d} t |djoP|oItid t fd |} | od d i | } qJn|i| ||}||t | o i| fS(sStrips DOCTYPE from XML document, returns (rss_version, stripped_data) rss_version may be 'rss091n' or None stripped_data is the same XML document, minus the DOCTYPE s<\wiis^\s*]*?)>R$s^\s*]*?)>itnetscapeR&s\s+(\w+)\s+"(&#\w+;|[^&"]*)"cs i|S((R(Rh(t safe_pattern(sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRbQ ss" ]>s > y0d"}|i|t||}d}}Wq;q;Xn| oKd#|jo>y0d#}|i|t||}d}}WqqXn| oKd$|jo>y0d$}|i|t||}d}}WqqXn|p:d|d|d<|i?|d.<|S(/s0Parse a feed from a URL, file, stream, or stringR=R?iRDitbozo_exceptionRscontent-encodingR$R4tfileobjR5RtETagRIs Last-ModifiedRLRKRJiRRqRs content-types%s is not an XML media typesno Content-type specifiedRscontent-locationscontent-languagei0s1The feed has not changed since you last checked, s:so the server sent no data. This is a feature, not a bug!t debug_messagesutf-8s windows-1252s iso-8859-2s#document encoding unknown, I tried s>%s, %s, utf-8, windows-1252, and iso-8859-2 but nothing workeds+documented declared as %s, but parsed as %st _ns_stackRs$http://www.w3.org/XML/1998/namespaceiNsxml parsing failed R(@R<t_XML_AVAILABLERlRmt InstanceTypeRURRRRxR4RRktGzipFileRGRAt decompresst MAX_WBITSRt getheaderRRKRR;RqRRiRRRRtchardettdetectRRR@RRAt make_parsertPREFERRED_XML_PARSERSt setFeatureRBtfeature_namespacestsetContentHandlertsetErrorHandlert xmlreadert InputSourcet setByteStreamRtparseRt tracebackt print_stackt print_excRRRRERR=RR?RR(RHRIRLRRJRKtresulttfR RhRt last_modifiedRRRRRt bozo_messageR RRtuse_strict_parsertknown_encodingttried_encodingstproposed_encodingt feedparsert saxparserRR((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRX s>       #"  #    "                     #   t SerializercBseZdZRS(cCs ||_dS(N(R(RR((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRs(RRR(((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRstTextSerializercBs eZeidZdZRS(cCs|i||iddS(NR$(t_writerR(Rtstream((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRsc Cs|pdSt|do|i}|ixp|D]o}|djoq9n|i|doq9n|i|doq9n|i|||||dq9Wnt|tijoNd}x|D]9}|i|||d d t|d |d 7}qWnyt|i d }|i d d}|i dd}|i dd}|i |d |i d|i ||i dWnnXdS(NRtRIR^RCt_parsedRiit[s].isutf-8s\s\\s R$s s\nt=(s descriptionslink( RxRtRrRiRRlRmRnRR"RR( RRRR RtR9RRR((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR!s>   ')  (RRRtstdoutRR(((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyRstPprintSerializercBseZeidZRS(cCs`|iido|i|iddnddkl}||i||iddS(NRJs i(tpprints (RRiRR (RRR ((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR>s (RRRR R(((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR =st__main__(t OptionParserRtusages$%prog [options] url_or_filename_or_-tformatR s-As --user-agenttdestRtmetavartAGENTthelpsUser-Agent for HTTP URLss-es --referers --referrerRJtURLsReferrer for HTTP URLss-ts--etagRItTAGs ETag/If-None-Match for HTTP URLss-ms--last-modifiedRLRsILast-modified/If-Modified-Since for HTTP URLs (any supported date format)s-fs--formattFORMATs'output results in FORMAT (text, pprint)s-vs --verboseRZt store_truetverboseRvs%write debugging information to stderrt_OptionscBs eZdZZZZdZRS(R N(RRRRIRLRRJR(((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyR^s(t__doc__t __version__t __license__t __author__t__contributors__RR8RBRRRRLRSRgR!RRWRRRRmRRR t cStringIORRGR4RRAtxml.saxRRARtxml.sax.saxutilsRR RR=RFtcjkcodecs.aliasest cjkcodecst iconv_codecRtchardet.constantst constantsRkRRRgt iteritemsR`t codepointR~R!R RxRRRRRRRR"ttagfindRtcharrefRRR RtSUPPORTED_VERSIONSR;R6t NameErrorR<RRRRVRRRRBRCR@RhRVRRRORQRNReRUtHTTPDigestAuthHandlerR tHTTPDefaultErrorHandlerRRURVRYt _iso8601_tmplR_ttmplRt _iso8601_reRqtregexRRlRt _korean_yeart _korean_montht _korean_dayt _korean_amR~RxR}R{RRRRRRRRRRRyRt_additional_timezonest _timezonesRRRRRRRRRR RtoptparseR t optionParsert set_defaultst add_optionRzt parse_argstoptionsturlsRt print_helptexittargvRtglobalsRkRt capitalizet serializerRKRIRLRRJRRR (((sE/home/sa3ruby/intertwingly.net/code/venus/planet/vendor/feedparser.pyt s:                  R   &[ )  '%6 h     r- J               ]  )    5    "%"""(     "0