2 more indentation fixes and fixed icons size

This commit is contained in:
Tomasz Długosz 2013-03-05 00:40:16 +01:00
parent 99df29c9ed
commit 83007ffdfa
6 changed files with 6 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1018 B

View File

@ -47,6 +47,6 @@ class KrytykaPolitycznaRecipe(BasicNewsRecipe):
def preprocess_html(self, soup): def preprocess_html(self, soup):
for alink in soup.findAll('a'): for alink in soup.findAll('a'):
if alink.string is not None: if alink.string is not None:
tstr = alink.string tstr = alink.string
alink.replaceWith(tstr) alink.replaceWith(tstr)
return soup return soup

View File

@ -15,7 +15,7 @@ class naszdziennik(BasicNewsRecipe):
no_stylesheets = True no_stylesheets = True
keep_only_tags =[dict(attrs = {'id' : 'article'})] keep_only_tags =[dict(attrs = {'id' : 'article'})]
#definiujemy nową funkcje; musi zwracać listę feedów wraz z artykułami #definiujemy nową funkcje; musi zwracać listę feedów wraz z artykułami
def parse_index(self): def parse_index(self):
#adres do parsowania artykułów #adres do parsowania artykułów
@ -28,7 +28,7 @@ class naszdziennik(BasicNewsRecipe):
sections = [] sections = []
#deklaracja pierwszej sekcji jako pusty string #deklaracja pierwszej sekcji jako pusty string
section = '' section = ''
#pętla for, która analizuje po kolei każdy tag "news-article" #pętla for, która analizuje po kolei każdy tag "news-article"
for item in soup.findAll(attrs = {'class' : 'news-article'}) : for item in soup.findAll(attrs = {'class' : 'news-article'}) :
#w tagu "news-article szukamy pierwszego taga h4" #w tagu "news-article szukamy pierwszego taga h4"
@ -51,11 +51,11 @@ class naszdziennik(BasicNewsRecipe):
#jako tytuł użyty będzie tekst pomiędzy tagami <a> #jako tytuł użyty będzie tekst pomiędzy tagami <a>
article_title = self.tag_to_string(article_a) article_title = self.tag_to_string(article_a)
#a data będzie tekstem z pierwszego taga h4 znalezionego w tagu title-datetime #a data będzie tekstem z pierwszego taga h4 znalezionego w tagu title-datetime
article_date = self.tag_to_string(article_title_datetime.find('h4')) article_date = self.tag_to_string(article_title_datetime.find('h4'))
#zebrane elementy dodajemy do listy zadeklarowanej w linijce 44 #zebrane elementy dodajemy do listy zadeklarowanej w linijce 44
articles[section].append( { 'title' : article_title, 'url' : article_url, 'date' : article_date }) articles[section].append( { 'title' : article_title, 'url' : article_url, 'date' : article_date })
#po dodaniu wszystkich artykułów dodajemy sekcje do listy feedów, korzystając z list sekcji znajdujących się w słowniku #po dodaniu wszystkich artykułów dodajemy sekcje do listy feedów, korzystając z list sekcji znajdujących się w słowniku
for section in sections: for section in sections:
feeds.append((section, articles[section])) feeds.append((section, articles[section]))
#zwracamy listę feedów, której parsowaniem zajmie się calibre #zwracamy listę feedów, której parsowaniem zajmie się calibre
return feeds return feeds