comparison 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
comparison
equal deleted inserted replaced
6:a7ee5c66e71c 7:ba1b1cbb0de6
139 139
140 for (i, (it_title, it_link)) in enumerate(items): 140 for (i, (it_title, it_link)) in enumerate(items):
141 if i > 0: 141 if i > 0:
142 p += " - " 142 p += " - "
143 143
144 p.a(_strip_html(it_title), href=it_link, klass="z%d" % (link_z % MAX_LINK_Z)) 144 if not it_title:
145 it_title = "(missing title)"
146 if it_link is not None:
147 p.a(_strip_html(it_title), href=it_link, klass="z%d" % (link_z % MAX_LINK_Z))
148 else:
149 p += _strip_html(it_title)
150
145 link_z += 1 151 link_z += 1
146 152
147 dtdelta = datetime.datetime.now() - dtnow 153 dtdelta = datetime.datetime.now() - dtnow
148 root.div("%.3f" % (dtdelta.days*86400 + dtdelta.seconds + dtdelta.microseconds/1e6), klass="debug") 154 root.div("%.3f" % (dtdelta.days*86400 + dtdelta.seconds + dtdelta.microseconds/1e6), klass="debug")
149 155