fix pyflakes errors

This commit is contained in:
Kovid Goyal 2014-06-11 21:19:21 +05:30
parent 42b2eeb3bc
commit 8f69acf446
4 changed files with 28 additions and 52 deletions

View File

@ -1,4 +1,3 @@
import re
from calibre.web.feeds.news import BasicNewsRecipe
class JerusalemPost(BasicNewsRecipe):
@ -21,24 +20,3 @@ class JerusalemPost(BasicNewsRecipe):
('Editorials', 'http://www.jpost.com/Rss/RssFeedsEditorialsNews.aspx'),
]
#remove_tags = [
#dict(id=lambda x: x and 'ads.' in x),
#dict(attrs={'class':['printinfo', 'tt1']}),
#dict(onclick='DoPrint()'),
#dict(name='input'),
#]
#conversion_options = {'linearize_tables':True}
#def preprocess_html(self, soup):
#for tag in soup.findAll('form'):
#tag.name = 'div'
#return soup
#def print_version(self, url):
#m = re.search(r'(ID|id)=(\d+)', url)
#if m is not None:
#id_ = m.group(2)
#return 'http://www.jpost.com/LandedPages/PrintArticle.aspx?id=%s'%id_
#return url

View File

@ -9,9 +9,7 @@ __description__ = 'PCMag (www.pcmag.com) delivers authoritative, labs-based comp
'''
http://www.pcmag.com/
'''
import re
from calibre.web.feeds.news import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import Comment
class pcMag(BasicNewsRecipe):
__author__ = 'Lorenzo Vigentini'

View File

@ -8,7 +8,7 @@ __copyright__ = 'tomashnyk@gmail.com'
import re
from calibre.web.feeds.recipes import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import BeautifulSoup,Tag
from calibre.ebooks.BeautifulSoup import BeautifulSoup
#This imports the version bundled with Calibre
import lxml
from lxml.builder import E

View File

@ -8,8 +8,8 @@ __copyright__ = 'tomashnyk@gmail.com'
import re,os,datetime
from calibre.web.feeds.recipes import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import BeautifulSoup,Tag
from calibre.constants import config_dir, CONFIG_DIR_MODE
from calibre.ebooks.BeautifulSoup import BeautifulSoup
from calibre.constants import config_dir
# This imports the version bundled with Calibre
import lxml
from lxml.builder import E
@ -30,10 +30,10 @@ class respektWebRecipe(BasicNewsRecipe):
p.indent_first_line {text-indent:30px;}'
remove_tags_before = dict(name='div',attrs={'class':['l']})
remove_tags_after = dict(id='text')
remove_tags = [dict(name='ul', attrs={'class':['tabs-d'],'id':['comm']}), \
dict(name='div',attrs={'class':['slot','reklama','date']}), \
dict(name='span', attrs={'class':['detail-vykrik']}), \
dict(name='p', attrs={'class':['detail-vykrik']}), \
remove_tags = [dict(name='ul', attrs={'class':['tabs-d'],'id':['comm']}),
dict(name='div',attrs={'class':['slot','reklama','date']}),
dict(name='span', attrs={'class':['detail-vykrik']}),
dict(name='p', attrs={'class':['detail-vykrik']}),
dict(name='div', attrs={'id':['col123d-video','col123d-infographic','col123d-gallery','col12d-discussion']}), # soup>lxml>soup in prprocess requires this
dict(name='strong', attrs={'class':['detail-vykrik']}),
dict(name='script')]
@ -49,7 +49,7 @@ class respektWebRecipe(BasicNewsRecipe):
def parse_index(self):
# Read already downloaded articles
recipe_dir = os.path.join(config_dir,'recipes')
old_articles = os.path.join(recipe_dir,self.title.encode('utf-8').replace('/',':'))
old_articles = os.path.join(recipe_dir,self.title)
past_items = []
if os.path.exists(old_articles):
with file(old_articles) as f: