ó
¿œ^c @ s™ d Z d d l Z d d l Z d d l m Z m Z d Z d Z d e j f d „ ƒ YZ e
d k r• e ƒ Z e j e ƒ ƒ e j
e j d ƒ n d S(
sx
A demo that reads in an RSS XML document and emits an HTML file containing
a list of the individual items in the feed.
iÿÿÿÿN( t make_parsert handlersÃ
%s
%s
sU
Converted to HTML by rss2html.py.
t
RSSHandlerc B s2 e Z e j d „ Z d „ Z d „ Z d „ Z RS( c C sb t j j | ƒ t j d ƒ | ƒ | _ d | _ d | _ t | _
d | _ d | _ d | _
d S( Ns utf-8t ( R t ContentHandlert __init__t codecst getwritert _outt _textt Nonet _parentt Falset
_list_startedt _titlet _linkt _descr( t selft out( ( s) /usr/lib64/python2.7/Demo/xml/rss2html.pyR ) s c C s= | d k s$ | d k s$ | d k r0 | | _ n d | _ d S( Nt channelt imaget itemR ( R R ( R t namet attrs( ( s) /usr/lib64/python2.7/Demo/xml/rss2html.pyt startElement6 s $c C sb | j d k rg | d k r> | j j t | j | j f ƒ q?| d k r?| j j d | j ƒ q?nØ | j d k r?| d k r‘ | j | _ q?| d k r¬ | j | _ q?| d k rÇ | j | _ q?| d k r?| j sø | j j d ƒ t | _ n | j j d | j | j | j f ƒ d | _ d | _ d | _ q?n | d
k r^| j j t ƒ n d S( NR t titlet descriptions
%s
R t links
s - %s %s
R t rss( R R t writet topR R R R R
t TrueR
t bottom( R R ( ( s) /usr/lib64/python2.7/Demo/xml/rss2html.pyt
endElement<