autopep8 with 120 chars line length on my modules
This commit is contained in:
parent
6a7bc0924d
commit
5d923bc73b
39 changed files with 434 additions and 426 deletions
|
|
@ -43,7 +43,8 @@ class ResultsPage(BasePage):
|
|||
imgs = self.parser.select(div, 'img.recipe-image')
|
||||
if len(imgs) > 0:
|
||||
thumbnail_url = unicode(imgs[0].attrib.get('src', ''))
|
||||
short_description = unicode(' '.join(self.parser.select(div,'div.infos_column',1).text_content().split()).strip())
|
||||
short_description = unicode(' '.join(self.parser.select(
|
||||
div, 'div.infos_column', 1).text_content().split()).strip())
|
||||
imgs_cost = self.parser.select(div, 'div.infos_column img')
|
||||
cost_tot = len(imgs_cost)
|
||||
cost_on = 0
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ class AttilasubBrowser(BaseBrowser):
|
|||
}
|
||||
|
||||
def iter_subtitles(self, language, pattern):
|
||||
self.location('http://search.freefind.com/find.html?id=81131980&_charset_=&bcd=%%F7&scs=1&pageid=r&query=%s&mode=Find%%20pages%%20matching%%20ALL%%20words' % pattern.encode('utf-8'))
|
||||
self.location('http://search.freefind.com/find.html?id=81131980&_charset_=&bcd=%%F7&scs=1&pageid=r&query=%s&mode=Find%%20pages%%20matching%%20ALL%%20words' %
|
||||
pattern.encode('utf-8'))
|
||||
assert self.is_on_page(SearchPage)
|
||||
return self.page.iter_subtitles(language, pattern)
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,8 @@ class ImdbBrowser(BaseBrowser):
|
|||
for m in jres[cat]:
|
||||
tdesc = unicode(m['title_description'])
|
||||
if '<a' in tdesc and '>' in tdesc:
|
||||
short_description = u'%s %s'%(tdesc.split('<')[0].strip(', '), tdesc.split('>')[1].split('<')[0])
|
||||
short_description = u'%s %s' % (tdesc.split('<')[
|
||||
0].strip(', '), tdesc.split('>')[1].split('<')[0])
|
||||
else:
|
||||
short_description = tdesc.strip(', ')
|
||||
movie = Movie(m['id'], latin2unicode(m['title']))
|
||||
|
|
@ -88,7 +89,8 @@ class ImdbBrowser(BaseBrowser):
|
|||
yield person
|
||||
|
||||
def get_movie(self, id):
|
||||
res = self.readurl('http://imdbapi.org/?id=%s&type=json&plot=simple&episode=1&lang=en-US&aka=full&release=simple&business=0&tech=0' % id )
|
||||
res = self.readurl(
|
||||
'http://imdbapi.org/?id=%s&type=json&plot=simple&episode=1&lang=en-US&aka=full&release=simple&business=0&tech=0' % id)
|
||||
if res is not None:
|
||||
jres = json.loads(res)
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@ class TorrentPage(BasePage):
|
|||
title = NotAvailable
|
||||
size = NotAvailable
|
||||
url = 'https://isohunt.com/download/%s/%s.torrent' % (id, id)
|
||||
title = unicode(self.parser.select(self.document.getroot(),'head > meta[name=title]',1).attrib.get('content',''))
|
||||
title = unicode(self.parser.select(
|
||||
self.document.getroot(), 'head > meta[name=title]', 1).attrib.get('content', ''))
|
||||
seed = NotAvailable
|
||||
leech = NotAvailable
|
||||
tip_id = "none"
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ class ResultsPage(BasePage):
|
|||
link = self.parser.select(tds[1], 'div.m_search_titre_recette a', 1)
|
||||
title = unicode(link.text)
|
||||
id = link.attrib.get('href', '').replace('.aspx', '').replace('/recettes/recette_', '')
|
||||
short_description = unicode(' '.join(self.parser.select(tds[1],'div.m_search_result_part4',1).text.strip().split('\n')))
|
||||
short_description = unicode(' '.join(self.parser.select(tds[
|
||||
1], 'div.m_search_result_part4', 1).text.strip().split('\n')))
|
||||
|
||||
recipe = Recipe(id, title)
|
||||
recipe.thumbnail_url = thumbnail_url
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ class OpensubtitlesBrowser(BaseBrowser):
|
|||
|
||||
def iter_subtitles(self, language, pattern):
|
||||
lang = LANGUAGE_CONV[language]
|
||||
self.location('http://www.opensubtitles.org/search2/sublanguageid-%s/moviename-%s' % (lang,pattern.encode('utf-8')))
|
||||
self.location('http://www.opensubtitles.org/search2/sublanguageid-%s/moviename-%s' % (
|
||||
lang, pattern.encode('utf-8')))
|
||||
assert self.is_on_page(SearchPage) or self.is_on_page(SubtitlesPage) or self.is_on_page(SubtitlePage)
|
||||
return self.page.iter_subtitles()
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,8 @@ class SeriePage(BasePage):
|
|||
if amount > 0:
|
||||
my_lang_img = self.parser.select(last_table_line, 'img[alt=%s]' % language)
|
||||
if len(my_lang_img) > 0:
|
||||
url_current_season = self.browser.geturl().split('/')[-1].replace('tvshow','subtitle').replace('.html','-%s.html'%language)
|
||||
url_current_season = self.browser.geturl().split('/')[-1].replace(
|
||||
'tvshow', 'subtitle').replace('.html', '-%s.html' % language)
|
||||
self.browser.location(url_current_season)
|
||||
assert self.browser.is_on_page(SeasonPage)
|
||||
yield self.browser.page.iter_subtitles()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue