mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
News download: Fix the check for empty feeds when generating man ToC page
Fixes #1834684 [TOC missing in news download (Python 3)](https://bugs.launchpad.net/calibre/+bug/1834684)
This commit is contained in:
parent
07f80229e9
commit
465ca0573b
@ -243,12 +243,6 @@ class Feed(object):
|
||||
def __str__(self):
|
||||
return repr(self)
|
||||
|
||||
def __bool__(self):
|
||||
for article in self:
|
||||
if getattr(article, 'downloaded', False):
|
||||
return True
|
||||
return False
|
||||
|
||||
def has_embedded_content(self):
|
||||
length = 0
|
||||
for a in self:
|
||||
|
@ -102,7 +102,7 @@ class IndexTemplate(Template):
|
||||
head.append(STYLE(extra_css, type='text/css'))
|
||||
ul = UL(attrs('calibre_feed_list'))
|
||||
for i, feed in enumerate(feeds):
|
||||
if feed:
|
||||
if len(feed):
|
||||
li = LI(A(feed.title, attrs('feed', rescale=120,
|
||||
href='feed_%d/index.html'%i)), id='feed_%d'%i)
|
||||
ul.append(li)
|
||||
@ -265,7 +265,7 @@ class TouchscreenIndexTemplate(Template):
|
||||
|
||||
toc = TABLE(attrs('toc'),width="100%",border="0",cellpadding="3px")
|
||||
for i, feed in enumerate(feeds):
|
||||
if feed:
|
||||
if len(feed):
|
||||
tr = TR()
|
||||
tr.append(TD(attrs(rescale=120), A(feed.title, href='feed_%d/index.html'%i)))
|
||||
tr.append(TD('%s' % len(feed.articles), style="text-align:right"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user