CanardPC by zorgluf and misc fixes

This commit is contained in:
Kovid Goyal 2010-04-17 22:07:28 +05:30
parent a1636eb24e
commit 1d24f95563
4 changed files with 19 additions and 3 deletions

View 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'})]

View File

@ -106,6 +106,7 @@ class Check(Command):
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)

View File

@ -1132,7 +1132,7 @@ class BeautifulStoneSoup(Tag, SGMLParser):
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 @@ class UnicodeDammit:
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

View File

@ -86,7 +86,7 @@ class PMLMLizer(object):
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