comment formating (manual)

ruff 'E114,E115,E116,E261,E262,E265'
This commit is contained in:
un-pogaz 2025-01-24 11:14:21 +01:00
parent 19b9d979ab
commit dba73b96b7
7 changed files with 35 additions and 35 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
# vim:fileencoding=utf-8 # vim:fileencoding=utf-8
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals

View File

@ -56,9 +56,9 @@ def bilderstrecke(soup,tag):
for v in struct: for v in struct:
if isinstance(v, dict) and 'caption' in v and 'defaultUrl' in v: if isinstance(v, dict) and 'caption' in v and 'defaultUrl' in v:
# if type(struct[i-1])== str: # if type(struct[i-1])== str:
# head = soup.new_tag("h4") # head = soup.new_tag("h4")
# head.append(struct[i-1]) # head.append(struct[i-1])
cap = soup.new_tag('p') cap = soup.new_tag('p')
cap.append(struct[int(v['caption'])]) cap.append(struct[int(v['caption'])])
cap['class'] = 'body-elements__image-figcaption' cap['class'] = 'body-elements__image-figcaption'
@ -172,10 +172,10 @@ class FazNet(BasicNewsRecipe):
else: else:
def parse_index(self): def parse_index(self):
test_article = 'https://www.faz.net/aktuell/stil/mode-im-em-jahr-wir-zeigen-wie-fussball-und-mode-zusammengehoeren-19766969.html' test_article = 'https://www.faz.net/aktuell/stil/mode-im-em-jahr-wir-zeigen-wie-fussball-und-mode-zusammengehoeren-19766969.html'
# test_article = 'https://www.faz.net/aktuell/feuilleton/buecher/film-eruption-ein-thriller-aus-dem-nachlass-von-michael-crichton-19770491.html' # test_article = 'https://www.faz.net/aktuell/feuilleton/buecher/film-eruption-ein-thriller-aus-dem-nachlass-von-michael-crichton-19770491.html'
# test_article = 'https://www.faz.net/aktuell/stil/mode-design/leonie-benesch-sandra-hueller-ist-eine-meiner-heldinnen-19671638.html' # test_article = 'https://www.faz.net/aktuell/stil/mode-design/leonie-benesch-sandra-hueller-ist-eine-meiner-heldinnen-19671638.html'
# test_article = 'https://www.faz.net/aktuell/feuilleton/medien/sabine-postel-zum-siebzigsten-die-briten-nannten-sie-german-traktor-19708409.html' # test_article = 'https://www.faz.net/aktuell/feuilleton/medien/sabine-postel-zum-siebzigsten-die-briten-nannten-sie-german-traktor-19708409.html'
# test_article = 'https://www.faz.net/aktuell/stil/mode-design/von-richert-beil-bis-william-fan-wer-kauft-denn-das-19666592.html' # test_article = 'https://www.faz.net/aktuell/stil/mode-design/von-richert-beil-bis-william-fan-wer-kauft-denn-das-19666592.html'
# test_article = 'https://www.faz.net/aktuell/feuilleton/buecher/rezensionen/sachbuch/tom-mustills-buch-die-sprache-der-wale-19657782.html' # test_article = 'https://www.faz.net/aktuell/feuilleton/buecher/rezensionen/sachbuch/tom-mustills-buch-die-sprache-der-wale-19657782.html'
if test_article: if test_article:
return [('Articles', [{'title': 'Test article', 'url': test_article}])] return [('Articles', [{'title': 'Test article', 'url': test_article}])]
@ -214,7 +214,7 @@ class FazNet(BasicNewsRecipe):
if len(par.contents) == 1: if len(par.contents) == 1:
cont = str(par.contents[0]) cont = str(par.contents[0])
if re.search(r'^[1-9]\d* Bilder$',cont): if re.search(r'^[1-9]\d* Bilder$',cont):
# print(cont) # print(cont)
for tag in soup.findAll('script',attrs={'id':'__NUXT_DATA__','type':'application/json'}): for tag in soup.findAll('script',attrs={'id':'__NUXT_DATA__','type':'application/json'}):
bilderstrecke(soup,tag) bilderstrecke(soup,tag)
break break

View File

@ -6,14 +6,14 @@ from calibre.web.feeds.news import BasicNewsRecipe
class UAFootball(BasicNewsRecipe): class UAFootball(BasicNewsRecipe):
# Russian version # Russian version
# title = 'UA-\u0424\u0443\u0442\u0431\u043E\u043B' # title = 'UA-\u0424\u0443\u0442\u0431\u043E\u043B'
# language = 'ru_UK' # language = 'ru_UK'
# feeds = [ # feeds = [
# ('\u041D\u043E\u0432\u043E\u0441\u0442\u0438 \u0444\u0443\u0442\u0431\u043E\u043B\u0430', 'https://www.ua-football.com/rss/all.xml') # ('\u041D\u043E\u0432\u043E\u0441\u0442\u0438 \u0444\u0443\u0442\u0431\u043E\u043B\u0430', 'https://www.ua-football.com/rss/all.xml')
# ] # ]
# Ukrainian version # Ukrainian version
title = 'UA-\u0424\u0443\u0442\u0431\u043E\u043B' title = 'UA-\u0424\u0443\u0442\u0431\u043E\u043B'
description = ('\u0410\u043A\u0442\u0443\u0430\u043B\u044C\u043D\u0456 \u0442\u0435\u043C\u0438' description = ('\u0410\u043A\u0442\u0443\u0430\u043B\u044C\u043D\u0456 \u0442\u0435\u043C\u0438'
' \u0444\u0443\u0442\u0431\u043E\u043B\u044C\u043D\u043E\u0433\u043E' ' \u0444\u0443\u0442\u0431\u043E\u043B\u044C\u043D\u043E\u0433\u043E'