Mercurial > hg > index.fcgi > www > www-1
diff myrss/myrss_app.py @ 72:c7bbd3805509
myrss: handle missing item links case
author | paulo |
---|---|
date | Fri, 08 Jan 2016 23:49:53 -0800 |
parents | 3456dd3e8660 |
children | d6acf8b093b7 |
line diff
1.1 --- a/myrss/myrss_app.py Wed Oct 28 00:57:23 2015 -0700 1.2 +++ b/myrss/myrss_app.py Fri Jan 08 23:49:53 2016 -0800 1.3 @@ -141,7 +141,13 @@ 1.4 if i > 0: 1.5 p += " - " 1.6 1.7 - p.a(_strip_html(it_title), href=it_link, klass="z%d" % (link_z % MAX_LINK_Z)) 1.8 + if not it_title: 1.9 + it_title = "(missing title)" 1.10 + if it_link is not None: 1.11 + p.a(_strip_html(it_title), href=it_link, klass="z%d" % (link_z % MAX_LINK_Z)) 1.12 + else: 1.13 + p += _strip_html(it_title) 1.14 + 1.15 link_z += 1 1.16 1.17 dtdelta = datetime.datetime.now() - dtnow