mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 09:23:14 +02:00
CanardPC by zorgluf and misc fixes
This commit is contained in:
parent
a1636eb24e
commit
1d24f95563
4 changed files with 19 additions and 3 deletions
15
resources/recipes/canardpc.recipe
Normal file
15
resources/recipes/canardpc.recipe
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class AdvancedUserRecipe1271446252(BasicNewsRecipe):
|
||||
title = u'CanardPC'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
language = 'fr'
|
||||
__author__ = 'zorgluf'
|
||||
|
||||
feeds = [(u'CanardPC', u'http://www.canardpc.com/feed.php')]
|
||||
remove_tags_after = dict(id='auteur_news')
|
||||
remove_tags_before = dict(id='fil_ariane')
|
||||
no_stylesheets = True
|
||||
remove_tags = [dict(name='a', attrs={'class':'news_tags'}),
|
||||
dict(name='div', attrs={'id':'fil_ariane'})]
|
||||
|
|
@ -106,6 +106,7 @@ def run(self, opts):
|
|||
if os.path.exists(wn_path):
|
||||
sys.path.insert(0, wn_path)
|
||||
self.info('\tChecking Changelog...')
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'calibre_servers.status.settings'
|
||||
import whats_new
|
||||
whats_new.test()
|
||||
sys.path.remove(wn_path)
|
||||
|
|
|
|||
|
|
@ -1132,7 +1132,7 @@ def reset(self):
|
|||
self.pushTag(self)
|
||||
|
||||
def popTag(self):
|
||||
tag = self.tagStack.pop()
|
||||
self.tagStack.pop()
|
||||
# Tags with just one string-owning child get the child as a
|
||||
# 'string' property, so that soup.tag.string is shorthand for
|
||||
# soup.tag.contents[0]
|
||||
|
|
@ -1727,7 +1727,7 @@ def _convertFrom(self, proposed):
|
|||
u = self._toUnicode(markup, proposed)
|
||||
self.markup = u
|
||||
self.originalEncoding = proposed
|
||||
except Exception, e:
|
||||
except Exception:
|
||||
#print "That didn't work!"
|
||||
#print e
|
||||
return None
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ def extract_content(self, oeb_book, opts):
|
|||
self.toc = {}
|
||||
for item in oeb_book.toc:
|
||||
href, mid, id = item.href.partition('#')
|
||||
aid = self.get_anchor_id(href, id)
|
||||
self.get_anchor_id(href, id)
|
||||
if not self.toc.get(href, None):
|
||||
self.toc[href] = {}
|
||||
self.toc[href][id] = item.title
|
||||
|
|
|
|||
Loading…
Reference in a new issue