mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-23 06:45:55 +01: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
2 changed files with 2 additions and 8 deletions
|
|
@ -243,12 +243,6 @@ def __repr__(self):
|
|||
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 @@ def _generate(self, title, masthead, datefmt, feeds, extra_css=None, style=None)
|
|||
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 @@ def _generate(self, title, masthead, datefmt, feeds, extra_css=None, style=None)
|
|||
|
||||
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…
Reference in a new issue