V
Qc @ 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.
iN( 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<