
    iB                     F    S SK r SSKJr  SSKJr  SSKJr   " S S\5      rg)    N   )_parse_date)make_safe_absolute_uri)FeedParserDictc                   `   \ rS rSrSrSSSSSSSSSSSSSS.rS rS rS rS r	S	 r
\
rS
 rS rS r\rS r\rS r\rS r\rS rS rS rS rS rS rS rS rS r\r\r S r!\!r"\!r#S r$S r%S r&\&r'S r(\(r)S r*\*r+S r,\,r-S  r.\.r/S! r0\0r1S" r2S# r3S$ r4S% r5S& r6\6r7\6r8S' r9\9r:\9r;S( r<\<r=\<r>S) r?\?r@\?rAS* rBS+ rCS, rDS- rES. rF\FrGS/ rH\HrIS0 rJS1 rKS2 rLS3 rM\MrNS4 rO\OrPS5 rQS6 rRS7 rSS8 rTS9 rU\UrVS: rW\WrXS; rY\YrZS< r[S= r\S> r]S? r^S@ r_SA r`SB raSC rbSD rc\crdSE re\erfSF rg\grh\gri\grj\grkSG rlSH rmSIrngJ)K	Namespace$   zSupport for the Atom, RSS, RDF, and CDF feed formats.

The feed formats all share common elements, some of which have conflicting
interpretations. For simplicity, all of the base feed format support is
collected here.
 )r
   zhttp://backend.userland.com/rssz%http://blogs.law.harvard.edu/tech/rsszhttp://purl.org/rss/1.0/z&http://my.netscape.com/rdf/simple/0.9/zhttp://example.com/newformat#zhttp://example.com/nechozhttp://purl.org/echo/zuri/of/echo/namespace#zhttp://purl.org/pie/zhttp://purl.org/atom/ns#zhttp://www.w3.org/2005/Atomz'http://purl.org/rss/1.0/modules/rss091#c                 "   SSSSS.nU R                   (       a   U R                   R                  S5      (       dW  UR                  SS5      nUR                  U5      nU(       a  X@l         g UR                  S	5      (       a  S
U l         g SU l         g g )Nrss091urss092rss093rss094)z0.91z0.92z0.93z0.94rssversionr
   z2.rss20)r   
startswithgetselfattrs_d
versionmapattr_versionr   s        H/app/mltbenv/lib/python3.13/site-packages/feedparser/namespaces/_base.py
_start_rssNamespace._start_rss<   s}    	

 ||4<<#:#:5#A#A";;y"5L nn\2G&((..&$ $B    c                 4    SU l         U R                  U5        g )N   )infeed_cdf_commonr   r   s     r   _start_channelNamespace._start_channelQ   s    !r   c                     SU;   a6  U R                  0 5        US   U R                  S   S'   U R                  5         SU;   a7  U R                  0 5        US   U R                  S   S'   U R	                  5         g g )Nlastmodhref)_start_modifiedelementstack_end_modified_start_link	_end_linkr"   s     r   r!   Namespace._cdf_commonU   s|      $(/	(:Db!"% WR (/Db!"%NN r   c                     SU l         SSSS.nU R                  (       d8  UR                  S5      nUR                  U5      nU(       a  X@l        g SU l        g g )Nr   atom01atom02atom03)z0.1z0.2z0.3r   atom)r    r   r   r   s        r   _start_feedNamespace._start_feed_   sR    %%%'
 ||";;y1L nn\2G&% r   c                     SU l         g )Nr   )r    r   s    r   _end_channelNamespace._end_channell   s	    r   c                     U R                  5       nU R                  (       d  UR                  S[        5       5        SU l        SU l        U R                  SS5        g )Nimager   r'   r   )_get_contextinentry
setdefaultr   inimagetitle_depthpushr   r   contexts      r   _start_imageNamespace._start_imagep   sG    ##%||w(89		'1r   c                 4    U R                  S5        SU l        g )Nr;   r   )popr?   r7   s    r   
_end_imageNamespace._end_imagex   s    r   c                     U R                  5       nUR                  S[        5       5        SU l        SU l        U R                  SS5        g )N	textinputr   r'   r   )r<   r>   r   intextinputr@   rA   rB   s      r   _start_textinputNamespace._start_textinput|   sA    ##%;(89		+q!r   c                 4    U R                  S5        SU l        g )NrK   r   )rG   rL   r7   s    r   _end_textinputNamespace._end_textinput   s    r   c                     SU l         U R                  SS5        U R                  5       nUR                  S/ 5        US   R	                  [        5       5        g )Nr   authorauthors)inauthorrA   r<   r>   appendr   rB   s      r   _start_authorNamespace._start_author   sK    		(A##%9b)	!!."23r   c                 T    U R                  S5        SU l        U R                  5         g )NrS   r   )rG   rU   _sync_author_detailr7   s    r   _end_authorNamespace._end_author   s!      "r   c                     SU l         U R                  5       nUR                  S/ 5        US   R                  [	        5       5        U R                  SS5        g )Nr   contributorscontributorr   )incontributorr<   r>   rV   r   rA   rB   s      r   _start_contributorNamespace._start_contributor   sL    ##%>2.&&~'78		-#r   c                 4    U R                  S5        SU l        g )Nr_   r   )rG   r`   r7   s    r   _end_contributorNamespace._end_contributor   s    r   c                 (    U R                  SS5        g )Nnamer   rA   r"   s     r   _start_nameNamespace._start_name       		&!r   c                 L   U R                  S5      nU R                  (       a  U R                  SUS5        g U R                  (       a  U R                  SU5        g U R                  (       a  U R                  SU5        g U R                  (       a  U R                  5       nXS'   g g )Nrg   	publisher)rG   inpublisher_save_authorrU   r`   _save_contributorrL   r<   r   valuerC   s      r   	_end_nameNamespace._end_name   s~     fe[9]]fe,""651'')G#FO r   c                 (    U R                  SS5        g Nwidthr   rh   r"   s     r   _start_widthNamespace._start_width       		'1r   c                     U R                  S5      n [        U5      nU R                  (       a  U R	                  5       nXS'   g g ! [         a    Sn N5f = frv   rG   int
ValueErrorr?   r<   rq   s      r   
_end_widthNamespace._end_width   sX    !	JE <<'')G$G   	E	   A AAc                 (    U R                  SS5        g Nheightr   rh   r"   s     r   _start_heightNamespace._start_height   s    		(Ar   c                     U R                  S5      n [        U5      nU R                  (       a  U R	                  5       nXS'   g g ! [         a    Sn N5f = fr   r|   rq   s      r   _end_heightNamespace._end_height   sX    "	JE <<'')G %H   	E	r   c                 (    U R                  SS5        g )Nr(   r   rh   r"   s     r   
_start_urlNamespace._start_url   rk   r   c                     U R                  S5      nU R                  (       a  U R                  SU5        g U R                  (       a  U R	                  SU5        g g )Nr(   )rG   rU   ro   r`   rp   r   rr   s     r   _end_urlNamespace._end_url   sE     ==fe,""651  r   c                 (    U R                  SS5        g )Nemailr   rh   r"   s     r   _start_emailNamespace._start_email   rz   r   c                     U R                  S5      nU R                  (       a  U R                  SUS5        g U R                  (       a  U R                  SU5        g U R                  (       a  U R                  SU5        g g )Nr   rm   )rG   rn   ro   rU   r`   rp   r   s     r   
_end_emailNamespace._end_email   s`    !guk:]]gu-""7E2  r   c                 ,    U R                  SUSS5        g )Nsubtitle
text/plainr   push_contentr"   s     r   _start_subtitleNamespace._start_subtitle   s    *g|Q?r   c                 &    U R                  S5        g )Nr   pop_contentr7   s    r   _end_subtitleNamespace._end_subtitle   s    $r   c                 ,    U R                  SUSS5        g )Nrightsr   r   r   r"   s     r   _start_rightsNamespace._start_rights   s    (G\1=r   c                 &    U R                  S5        g )Nr   r   r7   s    r   _end_rightsNamespace._end_rights   s    "r   c                    U R                   R                  [        5       5        U R                  SS5        SU l        SU l        SU l        U R                  US5      nU(       a  U R                  5       nX#S'   U R                  U5        g )Nitemr   r   r'   z	rdf:aboutid)
entriesrV   r   rA   r=   
guidislinkr@   _get_attributer<   r!   )r   r   r   rC   s       r   _start_itemNamespace._start_item   ss    N,-		&!  +6'')GDM!r   c                 B    U R                  S5        SU l        SU l        g )Nr   r   )rG   r=   
hasContentr7   s    r   	_end_itemNamespace._end_item  s    r   c                 (    U R                  SS5        g )Nlanguager   rh   r"   s     r   _start_languageNamespace._start_language	  s    		*a r   c                 0    U R                  S5      U l        g )Nr   )rG   langr7   s    r   _end_languageNamespace._end_language  s    HHZ(	r   c                 (    U R                  SS5        g )Nrm   r   rh   r"   s     r   _start_webmasterNamespace._start_webmaster      		+q!r   c                 H    U R                  S5        U R                  S5        g )Nrm   )rG   rZ   r7   s    r   _end_webmasterNamespace._end_webmaster  s      -r   c                 (    U R                  SS5        g )N	publishedr   rh   r"   s     r   _start_publishedNamespace._start_published  r   r   c                 Z    U R                  S5      nU R                  S[        U5      SS9  g )Nr   published_parsedT	overwriterG   _saver   r   s     r   _end_publishedNamespace._end_published  s(    %

%{5'9T
Jr   c                 (    U R                  SS5        g )Nupdatedr   rh   r"   s     r   _start_updatedNamespace._start_updated!      		)Qr   c                 ^    U R                  S5      n[        U5      nU R                  SUSS9  g )Nr   updated_parsedTr   )rG   r   r   )r   rr   parsed_values      r   _end_updatedNamespace._end_updated&  s-    #"5)

#\T
Br   c                 (    U R                  SS5        g )Ncreatedr   rh   r"   s     r   _start_createdNamespace._start_created-  r   r   c                 Z    U R                  S5      nU R                  S[        U5      SS9  g )Nr   created_parsedTr   r   r   s     r   _end_createdNamespace._end_created0  s(    #

#[%74
Hr   c                 (    U R                  SS5        g )Nexpiredr   rh   r"   s     r   _start_expirationdateNamespace._start_expirationdate4  r   r   c                 V    U R                  S[        U R                  S5      5      SS9  g )Nexpired_parsedr   Tr   )r   r   rG   r7   s    r   _end_expirationdateNamespace._end_expirationdate7  s$    

#[)1D%EQU
Vr   c                     UR                  S5      nUR                  SUR                  S5      5      nUR                  S5      nU R                  X#U5        U R                  SS5        g )Ntermschemedomainlabelcategoryr   )r   _add_tagrA   )r   r   r   r   r   s        r   _start_categoryNamespace._start_category:  sS    {{6"Xw{{8'<=G$dE*		*a r   c                     U R                  S5      nU(       d  g U R                  5       nUS   nU(       a%  [        U5      (       a  US   S   (       d  XS   S'   g U R                  US S 5        g )Nr   tagsr'   r   )rG   r<   lenr   )r   rr   rC   r   s       r   _end_categoryNamespace._end_categoryB  s_    $##%vSYYtBx'7$HVMM%t,r   c                 <    [        U5      U R                  5       S'   g )Ncloud)r   r<   r"   s     r   _start_cloudNamespace._start_cloudN  s    '5g'>G$r   c                    UR                  SS5        US   S:X  a  UR                  SS5        OUR                  SS5        U R                  5       nU R                  U5      nSU;   a  U R                  US   5      US'   U R                  =(       d    U R
                  =(       d    U R                  nUR                  S/ 5        U R
                  (       a  U R                  (       d  US   R                  [        U5      5        SU;   aN  UR                  S5      S:X  a8  U R                  UR                  S5      5      U R                  ;   a	  US   US	'   g g g U R                  S	U5        g )
Nrel	alternater   typezapplication/atom+xml	text/htmlr(   linkslink)r>   r<   _enforce_hrefresolve_urir    r=   insourcer?   rV   r   r   map_content_type
html_typesrA   )r   r   rC   expecting_texts       r   r,   Namespace._start_linkQ  s.   5+.5>V#v'=>v{3##%$$W-W"..wv?GFOEE7B'G##N7$;<WKK&+5--gkk&.ABdooU")&/ V 6
 IIfn-r   c                 &    U R                  S5        g )Nr  )rG   r7   s    r   r-   Namespace._end_linkh  s    r   c                 \    UR                  SS5      S:H  U l        U R                  SS5        g )Nispermalinktruer   r   )r   r   rA   r"   s     r   _start_guidNamespace._start_guidk  s'    ";;}f=G		$r   c                     U R                  S5      nU R                  SU R                  =(       a    SU R                  5       ;  5        U R                  (       a  U R                  SU5        g g )Nr   r   r  )rG   r   r   r<   r   s     r   	_end_guidNamespace._end_guidp  sP    

<!VV4CTCTCV5VW?? JJvu% r   c                     U R                   (       a)  U R                  S[        UR                  5       5      5      $ U R	                  SUSU R
                  =(       d    U R                  =(       d    U R                  5        g )Ntitler   )svgOKunknown_starttaglistitemsr   r    r=   r  r"   s     r   _start_titleNamespace._start_titley  sT    ::(($w}}2GHH'7L$++:f:fY]YfYfgr   c                 |    U R                   (       a  g U R                  S5      nU(       d  g U R                  U l        g )Nr  )r  r   depthr@   r   s     r   
_end_titleNamespace._end_title~  s.    ::  )::r   c                    U R                  5       nSU;   a*  U R                  (       d  SU l        U R                  U5        g U R	                  SUSU R
                  =(       d    U R                  =(       d    U R                  5        g )Nsummarycontentdescriptionr  )r<   r   _summaryKey_start_contentr   r    r=   r  rB   s      r   _start_descriptionNamespace._start_description  sd    ##%(D(mWk4;;CoRVR^R^Cobfbobopr   c                     U R                  SUSU R                  =(       d    U R                  =(       d    U R                  5        g )Nr%  r   )r   r    r=   r  r"   s     r   _start_abstractNamespace._start_abstract  s/    -,@lt||@l_c_l_lmr   c                 v    U R                   S:X  a  U R                  5         OU R                  S5        S U l         g )Nr$  r%  r&  _end_contentr   r7   s    r   _end_descriptionNamespace._end_description  s2    y(]+r   c                 ,    U R                  SUSS5        g )Ninfor   r   r   r"   s     r   _start_infoNamespace._start_info  s    &'<;r   c                 &    U R                  S5        g )Nr3  r   r7   s    r   	_end_infoNamespace._end_info  s     r   c                     U(       a.  U R                  U5      nSU;   a  U R                  US   5      US'   [        U5      U R                  5       S'   U R	                  SS5        g )Nr(   generator_detail	generatorr   )r  r  r   r<   rA   r"   s     r   _start_generatorNamespace._start_generator  s\    ((1G "&"2"276?"C2@2I./		+q!r   c                 b    U R                  S5      nU R                  5       nSU;   a  XS   S'   g g )Nr;  r:  rg   )rG   r<   rq   s      r   _end_generatorNamespace._end_generator  s9    %##%(27&'/ )r   c                     U R                  5       nSU;   a*  U R                  (       d  SU l        U R                  U5        g SU l        U R	                  U R                  USS5        g )Nr#  r$  r   r   )r<   r   r&  r'  r   rB   s      r   _start_summaryNamespace._start_summary  sV    ##%(D((Dd..qIr   c                     U R                   S:X  a  U R                  5         O$U R                  U R                   =(       d    S5        S U l         g )Nr$  r#  r.  r7   s    r   _end_summaryNamespace._end_summary  s=    y(T--:;r   c                     U R                  U5      nU R                  5       nSUS'   UR                  S/ 5      R                  [	        U5      5        g )N	enclosurer   r  )r  r<   r>   rV   r   rB   s      r   _start_enclosureNamespace._start_enclosure  sI    $$W-##%$7B'..~g/FGr   c                 t    SU;   a  US   U R                   S'   U R                  SS5        SU l        SU l        g )Nurlr(   sourcer   r'   )
sourcedatarA   r  r@   r"   s     r   _start_sourceNamespace._start_source  s9    G&-enDOOF#		(Ar   c                     SU l         U R                  S5      nU(       a  XR                  S'   [        R                  " U R                  5      U R                  5       S'   U R                  R                  5         g )Nr   rM  r  )r  rG   rN  copydeepcopyr<   clearr   s     r   _end_sourceNamespace._end_source  sV    "',OOG$(,doo(FH%r   c                     SU l         U R                  SUSS5        UR                  S5      nU(       a  X R                  S'   U R	                  SS5        g )Nr   r$  r   src)r   r   r   contentparamsrA   )r   r   rX  s      r   r'  Namespace._start_content  sJ    )WlA>kk% (+u%		)Qr   c                 ,    U R                  SUSS5        g )Nr$  zapplication/xhtml+xmlr   r   r"   s     r   _start_bodyNamespace._start_body  s    )W.EqIr   c                 :    SU l         U R                  SUSS5        g )Nr   r$  r  )r   r   r"   s     r   _start_content_encoded Namespace._start_content_encoded  s    )Wk1=r   c                     U R                  U R                  R                  S5      5      S1U R                  -  ;   nU R	                  S5      nU(       a  U R                  SU5        g g )Nr  r   r$  r#  )r  rY  r   r	  r   r   )r   copyToSummaryrr   s      r   r/  Namespace._end_content  s^    --d.@.@.D.DV.LMS_R`cgcrcrRrs  +JJy%( r   c                 (    U R                  SS5        g )Nnewlocationr   rh   r"   s     r   _start_newlocationNamespace._start_newlocation  s    		-#r   c                     U R                  S5      nU R                  5       nX R                  La  g [        U R                  UR                  5       5      US'   g )Nre  )rG   r<   feeddatar   baseuristrip)r   rL  rC   s      r   _end_newlocationNamespace._end_newlocation  sF    hh}%##%--'!7ciik!Rr   )r&  r   r   rU   r`   r=   r    r?   r  rL   r   r@   r   N)o__name__
__module____qualname____firstlineno____doc__supported_namespacesr   r#   r!   r4   r8   	_end_feedrD   rH   rM   _start_textInputrP   _end_textInputrW   _start_managingeditorr[   _end_managingeditorra   rd   ri   rs   rx   r   r   r   r   _start_homepage
_start_urir   _end_homepage_end_urir   r   r   _start_tagliner   _end_tagliner   _start_copyrightr   _end_copyrightr   _start_entryr   
_end_entryr   r   r   r   r   _start_issued_start_pubdater   _end_issued_end_pubdater   r)   _start_lastbuilddater   r+   _end_lastbuilddater   r   r   r   r   _start_keywordsr   _end_keywordsr   r,   r-   r  	_start_idr  _end_idr  r   r(  r+  r0  _end_abstractr4  !_start_feedburner_browserfriendlyr7  _end_feedburner_browserfriendlyr<  r?  rB  rE  rI  rO  rU  r'  r\  _start_xhtml_bodyr_  _start_fullitemr/  	_end_body_end_xhtml_body_end_content_encoded_end_fullitemrf  rl  __static_attributes__ r   r   r   r   $   sv    +-13$&24)+$&!#"$ "$&')35 %*"&I" ( $N4 *# &$
$%& OJ2 MH3@$N% L>$# N
" L J!)"."$M%NK !K!L $O)C !M% I W! &O	- "M?.. I& Gh
&qn  %M<(3%!&/#"8J H  J#> -O) I"O' M$Sr   r   )	rR  	datetimesr   urlsr   utilr   objectr   r  r   r   <module>r     s#   :  # ) !VS VSr   