From ed2930712d6d733029802d1d045b8925c53b98eb Mon Sep 17 00:00:00 2001 From: un-pogaz <46523284+un-pogaz@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:14:24 +0100 Subject: [PATCH] various whitespace (extra-edit) !partial 'E203,E222,E241,E271,E272' --- recipes/1843.recipe | 4 +- recipes/aktualne.cz.recipe | 2 +- recipes/al_jazeera.recipe | 2 +- recipes/am730.recipe | 2 +- recipes/barrons.recipe | 2 +- recipes/before_we_go.recipe | 2 +- recipes/blesk.recipe | 6 +- recipes/calgary_herald.recipe | 2 +- recipes/cherta.recipe | 2 +- recipes/clarin.recipe | 10 +- recipes/coda_ru.recipe | 2 +- recipes/computer_weekly.recipe | 2 +- recipes/contropiano.recipe | 25 +- recipes/cumhuriyet.recipe | 4 +- recipes/degentenaar.recipe | 2 +- recipes/denik_referendum.recipe | 2 +- recipes/deutschland_funk.recipe | 2 +- recipes/dev_ua.recipe | 2 +- recipes/echo_moskvy.recipe | 2 +- recipes/economist_espresso.recipe | 2 +- recipes/edmonton_journal.recipe | 2 +- recipes/el_pais.recipe | 2 +- recipes/epoch_times.recipe | 2 +- recipes/fastcompany.recipe | 2 +- recipes/faz_net.recipe | 30 +- recipes/fluter_de.recipe | 4 +- recipes/folhadesaopaulo_sub.recipe | 2 +- recipes/footballua.recipe | 2 +- recipes/foreignaffairs.recipe | 2 +- recipes/gagadget_de.recipe | 2 +- recipes/gagadget_en.recipe | 2 +- recipes/gagadget_es.recipe | 2 +- recipes/gagadget_fr.recipe | 2 +- recipes/gagadget_it.recipe | 2 +- recipes/gagadget_nb.recipe | 2 +- recipes/gagadget_nl.recipe | 2 +- recipes/gagadget_ru.recipe | 2 +- recipes/gagadget_ua.recipe | 2 +- recipes/gazetaua_ru.recipe | 2 +- recipes/gazetaua_ua.recipe | 2 +- recipes/geekcity.recipe | 2 +- recipes/gorky.recipe | 2 +- recipes/hindustan.recipe | 2 +- recipes/idnes.recipe | 5 +- recipes/il_fatto.recipe | 28 +- recipes/il_messaggero.recipe | 2 +- recipes/ilmanifesto.recipe | 4 +- recipes/india_today.recipe | 2 +- recipes/irish_times.recipe | 2 +- recipes/jot_down.recipe | 2 +- recipes/kompiutierra.recipe | 2 +- recipes/kudy_z_nudy.recipe | 2 +- recipes/la_jornada.recipe | 2 +- recipes/libertad_digital.recipe | 2 +- recipes/lrb.recipe | 2 +- recipes/marca.recipe | 2 +- recipes/mediapart.recipe | 2 +- recipes/montreal_gazette.recipe | 2 +- recipes/moscowtimes_en.recipe | 2 +- recipes/naszdziennik.recipe | 2 +- recipes/navy_times.recipe | 14 +- recipes/nepszabadsag.recipe | 2 +- recipes/nikkei_news.recipe | 2 +- recipes/novinky.cz.recipe | 10 +- recipes/nu.recipe | 2 +- recipes/old_games.recipe | 2 +- recipes/ottawa_citizen.recipe | 2 +- recipes/pagina12.recipe | 22 +- recipes/paperpaper.recipe | 2 +- recipes/parlamentni_listy.recipe | 2 +- recipes/popscience.recipe | 2 +- recipes/private_eye.recipe | 2 +- recipes/pro_physik.recipe | 2 +- recipes/prosleduet.recipe | 2 +- recipes/radio_canada.recipe | 2 +- recipes/real_clear.recipe | 19 +- recipes/respekt_magazine.recipe | 4 +- recipes/rnd.recipe | 2 +- recipes/saechsische.recipe | 10 +- recipes/scmp.recipe | 2 +- recipes/sobaka.recipe | 2 +- recipes/sotavision.recipe | 2 +- recipes/spectator_magazine.recipe | 2 +- recipes/straitstimes.recipe | 20 +- recipes/t_invariant_en.recipe | 2 +- recipes/t_invariant_ru.recipe | 2 +- recipes/t_invariant_ua.recipe | 2 +- recipes/the_philippine_daily_inquirer.recipe | 141 +- recipes/theoldie.recipe | 2 +- recipes/tmz.recipe | 30 +- recipes/toi.recipe | 2 +- recipes/ua_fooball.recipe | 2 +- recipes/ukrinform_es.recipe | 2 +- recipes/vancouver_province.recipe | 2 +- recipes/vancouver_sun.recipe | 2 +- recipes/version2.recipe | 4 +- recipes/vikna_ru.recipe | 2 +- recipes/weblogs_sl.recipe | 2 +- recipes/wicomix.recipe | 2 +- recipes/windows_star.recipe | 2 +- recipes/wired.recipe | 2 +- recipes/wsj_free.recipe | 2 +- recipes/zeitde.recipe | 2 +- recipes/zerkalo.recipe | 2 +- setup/iso_codes.py | 2 +- setup/plugins_mirror.py | 4 +- setup/translations.py | 2 +- src/calibre/__init__.py | 18 +- src/calibre/customize/builtins.py | 4 +- src/calibre/db/adding.py | 2 +- src/calibre/db/constants.py | 2 +- src/calibre/db/fields.py | 12 +- src/calibre/db/legacy.py | 22 +- src/calibre/db/search.py | 2 +- src/calibre/db/tests/legacy.py | 2 +- src/calibre/db/tests/reading.py | 14 +- src/calibre/db/tests/writing.py | 2 +- src/calibre/db/utils.py | 2 +- src/calibre/debug.py | 6 +- src/calibre/devices/android/driver.py | 242 ++-- src/calibre/devices/kindle/driver.py | 2 +- src/calibre/devices/kobo/bookmark.py | 2 +- src/calibre/devices/kobo/books.py | 2 +- src/calibre/devices/kobo/driver.py | 44 +- src/calibre/devices/mtp/filesystem_cache.py | 2 +- src/calibre/devices/prs505/sony_cache.py | 4 +- .../devices/smart_device_app/driver.py | 13 +- src/calibre/devices/winusb.py | 2 +- src/calibre/ebooks/chardet.py | 2 +- src/calibre/ebooks/conversion/cli.py | 14 +- .../ebooks/conversion/plugins/comic_input.py | 4 +- .../ebooks/conversion/plugins/epub_input.py | 2 +- .../ebooks/conversion/plugins/pdf_output.py | 2 +- .../ebooks/conversion/plugins/rtf_input.py | 6 +- .../ebooks/conversion/plugins/snb_input.py | 6 +- src/calibre/ebooks/conversion/preprocess.py | 2 +- src/calibre/ebooks/conversion/utils.py | 2 +- src/calibre/ebooks/djvu/djvu.py | 2 +- src/calibre/ebooks/djvu/djvubzzdec.py | 2 +- src/calibre/ebooks/docx/block_styles.py | 2 +- src/calibre/ebooks/docx/index.py | 2 +- src/calibre/ebooks/docx/names.py | 28 +- src/calibre/ebooks/docx/numbering.py | 4 +- src/calibre/ebooks/docx/tables.py | 2 +- src/calibre/ebooks/docx/writer/styles.py | 8 +- src/calibre/ebooks/html/input.py | 2 +- src/calibre/ebooks/htmlz/oeb2html.py | 2 +- src/calibre/ebooks/lrf/__init__.py | 4 +- src/calibre/ebooks/lrf/fonts.py | 6 +- src/calibre/ebooks/lrf/html/convert_from.py | 4 +- src/calibre/ebooks/lrf/lrs/convert_from.py | 2 +- src/calibre/ebooks/lrf/meta.py | 4 +- src/calibre/ebooks/lrf/objects.py | 30 +- src/calibre/ebooks/lrf/pylrs/pylrf.py | 2 +- src/calibre/ebooks/lrf/pylrs/pylrs.py | 6 +- src/calibre/ebooks/lrf/tags.py | 2 +- src/calibre/ebooks/metadata/archive.py | 2 +- src/calibre/ebooks/metadata/book/base.py | 4 +- .../ebooks/metadata/book/json_codec.py | 6 +- src/calibre/ebooks/metadata/book/render.py | 2 +- src/calibre/ebooks/metadata/html.py | 2 +- src/calibre/ebooks/metadata/mobi.py | 12 +- src/calibre/ebooks/metadata/opf2.py | 4 +- src/calibre/ebooks/metadata/pdb.py | 14 +- src/calibre/ebooks/metadata/sources/amazon.py | 2 +- .../ebooks/metadata/sources/search_engines.py | 2 +- src/calibre/ebooks/metadata/topaz.py | 6 +- src/calibre/ebooks/mobi/debug/headers.py | 24 +- src/calibre/ebooks/mobi/debug/mobi6.py | 22 +- src/calibre/ebooks/mobi/mobiml.py | 2 +- src/calibre/ebooks/mobi/reader/headers.py | 2 +- src/calibre/ebooks/mobi/reader/ncx.py | 22 +- src/calibre/ebooks/mobi/writer2/indexer.py | 4 +- src/calibre/ebooks/mobi/writer2/serializer.py | 2 +- src/calibre/ebooks/mobi/writer8/index.py | 4 +- src/calibre/ebooks/mobi/writer8/skeleton.py | 6 +- src/calibre/ebooks/oeb/normalize_css.py | 22 +- src/calibre/ebooks/oeb/parse_utils.py | 2 +- .../ebooks/oeb/polish/check/parsing.py | 2 +- src/calibre/ebooks/oeb/polish/parsing.py | 2 +- src/calibre/ebooks/oeb/polish/report.py | 6 +- .../ebooks/oeb/polish/tests/structure.py | 4 +- src/calibre/ebooks/oeb/transforms/flatcss.py | 8 +- src/calibre/ebooks/oeb/transforms/metadata.py | 6 +- src/calibre/ebooks/oeb/transforms/split.py | 4 +- src/calibre/ebooks/pdf/reflow.py | 44 +- src/calibre/ebooks/pdf/render/fonts.py | 2 +- src/calibre/ebooks/pdf/render/serialize.py | 18 +- src/calibre/ebooks/pml/pmlml.py | 8 +- src/calibre/ebooks/rb/rbml.py | 2 +- src/calibre/ebooks/readability/readability.py | 2 +- src/calibre/ebooks/rtf/preprocess.py | 4 +- src/calibre/ebooks/rtf/rtfml.py | 2 +- src/calibre/ebooks/rtf2xml/ParseRtf.py | 12 +- src/calibre/ebooks/rtf2xml/add_brackets.py | 64 +- src/calibre/ebooks/rtf2xml/border_parse.py | 96 +- src/calibre/ebooks/rtf2xml/check_encoding.py | 2 +- src/calibre/ebooks/rtf2xml/colors.py | 4 +- src/calibre/ebooks/rtf2xml/combine_borders.py | 2 +- src/calibre/ebooks/rtf2xml/configure_txt.py | 2 +- src/calibre/ebooks/rtf2xml/convert_to_tags.py | 18 +- src/calibre/ebooks/rtf2xml/copy.py | 4 +- src/calibre/ebooks/rtf2xml/delete_info.py | 18 +- src/calibre/ebooks/rtf2xml/field_strings.py | 178 +-- src/calibre/ebooks/rtf2xml/fields_large.py | 2 +- src/calibre/ebooks/rtf2xml/fields_small.py | 16 +- src/calibre/ebooks/rtf2xml/fonts.py | 6 +- src/calibre/ebooks/rtf2xml/footnote.py | 2 +- src/calibre/ebooks/rtf2xml/get_options.py | 64 +- src/calibre/ebooks/rtf2xml/group_borders.py | 8 +- src/calibre/ebooks/rtf2xml/group_styles.py | 10 +- src/calibre/ebooks/rtf2xml/header.py | 18 +- .../ebooks/rtf2xml/headings_to_sections.py | 8 +- src/calibre/ebooks/rtf2xml/hex_2_utf8.py | 32 +- src/calibre/ebooks/rtf2xml/info.py | 42 +- src/calibre/ebooks/rtf2xml/inline.py | 98 +- src/calibre/ebooks/rtf2xml/list_numbers.py | 8 +- src/calibre/ebooks/rtf2xml/list_table.py | 32 +- src/calibre/ebooks/rtf2xml/make_lists.py | 8 +- src/calibre/ebooks/rtf2xml/old_rtf.py | 24 +- src/calibre/ebooks/rtf2xml/output.py | 2 +- src/calibre/ebooks/rtf2xml/override_table.py | 10 +- src/calibre/ebooks/rtf2xml/paragraph_def.py | 356 +++--- src/calibre/ebooks/rtf2xml/paragraphs.py | 48 +- src/calibre/ebooks/rtf2xml/pict.py | 10 +- src/calibre/ebooks/rtf2xml/preamble_div.py | 118 +- src/calibre/ebooks/rtf2xml/preamble_rest.py | 12 +- src/calibre/ebooks/rtf2xml/process_tokens.py | 10 +- src/calibre/ebooks/rtf2xml/sections.py | 32 +- src/calibre/ebooks/rtf2xml/styles.py | 314 ++--- src/calibre/ebooks/rtf2xml/table.py | 28 +- src/calibre/ebooks/rtf2xml/tokenize.py | 4 +- src/calibre/ebooks/snb/snbfile.py | 8 +- src/calibre/ebooks/textile/functions.py | 2 +- src/calibre/gui2/__init__.py | 2 +- src/calibre/gui2/actions/__init__.py | 2 +- src/calibre/gui2/actions/add.py | 4 +- src/calibre/gui2/actions/choose_library.py | 2 +- src/calibre/gui2/actions/tweak_epub.py | 2 +- src/calibre/gui2/actions/view.py | 2 +- src/calibre/gui2/book_details.py | 6 +- src/calibre/gui2/catalog/catalog_bibtex.py | 8 +- src/calibre/gui2/catalog/catalog_epub_mobi.py | 54 +- src/calibre/gui2/comments_editor.py | 6 +- src/calibre/gui2/convert/gui_conversion.py | 4 +- src/calibre/gui2/convert/metadata.py | 2 +- .../gui2/convert/search_and_replace.py | 8 +- src/calibre/gui2/custom_column_widgets.py | 18 +- src/calibre/gui2/device.py | 24 +- src/calibre/gui2/device_drivers/mtp_config.py | 2 +- src/calibre/gui2/dialogs/catalog.py | 4 +- .../gui2/dialogs/data_files_manager.py | 2 +- src/calibre/gui2/dialogs/duplicates.py | 2 +- src/calibre/gui2/dialogs/exim.py | 6 +- src/calibre/gui2/dialogs/ff_doc_editor.py | 4 +- src/calibre/gui2/dialogs/message_box.py | 2 +- src/calibre/gui2/dialogs/metadata_bulk.py | 20 +- src/calibre/gui2/dialogs/plugin_updater.py | 2 +- src/calibre/gui2/dialogs/progress.py | 2 +- src/calibre/gui2/dialogs/search.py | 4 +- src/calibre/gui2/email.py | 2 +- src/calibre/gui2/fts/search.py | 2 +- src/calibre/gui2/geometry.py | 2 +- src/calibre/gui2/icon_theme.py | 10 +- src/calibre/gui2/keyboard.py | 4 +- src/calibre/gui2/layout.py | 2 +- src/calibre/gui2/library/alternate_views.py | 2 +- src/calibre/gui2/library/models.py | 18 +- src/calibre/gui2/lrf_renderer/document.py | 2 +- src/calibre/gui2/lrf_renderer/main.py | 4 +- src/calibre/gui2/lrf_renderer/text.py | 14 +- src/calibre/gui2/markdown_editor.py | 2 +- .../gui2/markdown_syntax_highlighter.py | 4 +- src/calibre/gui2/metadata/basic_widgets.py | 6 +- src/calibre/gui2/metadata/config.py | 2 +- src/calibre/gui2/metadata/single.py | 4 +- src/calibre/gui2/preferences/coloring.py | 20 +- .../gui2/preferences/create_custom_column.py | 4 +- src/calibre/gui2/preferences/emailp.py | 4 +- src/calibre/gui2/preferences/look_feel.py | 4 +- .../look_feel_tabs/tb_hierarchy.py | 2 +- .../gui2/preferences/metadata_sources.py | 6 +- .../gui2/preferences/texture_chooser.py | 2 +- src/calibre/gui2/preferences/toolbar.py | 2 +- src/calibre/gui2/search_box.py | 2 +- .../gui2/store/config/chooser/models.py | 2 +- .../gui2/store/config/chooser/results_view.py | 2 +- src/calibre/gui2/store/search/search.py | 6 +- .../gui2/store/stores/archive_org_plugin.py | 2 +- .../gui2/store/stores/chitanka_plugin.py | 2 +- .../gui2/store/stores/litres_plugin.py | 4 +- .../gui2/store/stores/mills_boon_uk_plugin.py | 2 +- .../gui2/store/stores/swiatebookow_plugin.py | 2 +- src/calibre/gui2/tag_browser/model.py | 20 +- src/calibre/gui2/toc/location.py | 2 +- src/calibre/gui2/toc/main.py | 12 +- src/calibre/gui2/tts/download.py | 2 +- src/calibre/gui2/tweak_book/__init__.py | 2 +- src/calibre/gui2/tweak_book/boss.py | 2 +- src/calibre/gui2/tweak_book/diff/main.py | 6 +- src/calibre/gui2/tweak_book/diff/view.py | 2 +- .../gui2/tweak_book/editor/snippets.py | 2 +- src/calibre/gui2/tweak_book/editor/text.py | 2 +- src/calibre/gui2/tweak_book/editor/themes.py | 4 +- src/calibre/gui2/tweak_book/file_list.py | 4 +- src/calibre/gui2/tweak_book/live_css.py | 4 +- src/calibre/gui2/tweak_book/preferences.py | 2 +- src/calibre/gui2/tweak_book/reports.py | 2 +- src/calibre/gui2/tweak_book/search.py | 8 +- src/calibre/gui2/tweak_book/spell.py | 10 +- src/calibre/gui2/tweak_book/ui.py | 6 +- src/calibre/gui2/tweak_book/widgets.py | 2 +- src/calibre/gui2/viewer/bookmarks.py | 2 +- src/calibre/gui2/viewer/web_view.py | 2 +- src/calibre/gui2/widgets2.py | 2 +- src/calibre/gui2/win_file_dialogs.py | 2 +- src/calibre/gui2/wizard/__init__.py | 6 +- src/calibre/gui2/wizard/send_email.py | 2 +- src/calibre/library/add_to_library.py | 4 +- src/calibre/library/caches.py | 4 +- src/calibre/library/catalogs/bibtex.py | 104 +- .../library/catalogs/epub_mobi_builder.py | 8 +- src/calibre/library/catalogs/utils.py | 4 +- src/calibre/library/comments.py | 2 +- src/calibre/library/custom_columns.py | 4 +- src/calibre/library/database.py | 38 +- src/calibre/library/database2.py | 4 +- src/calibre/library/field_metadata.py | 42 +- src/calibre/library/sqlite.py | 6 +- src/calibre/linux.py | 2 +- src/calibre/scraper/qt_backend.py | 2 +- src/calibre/spell/dictionary.py | 2 +- src/calibre/srv/auto_reload.py | 2 +- src/calibre/srv/books.py | 2 +- src/calibre/srv/legacy.py | 2 +- src/calibre/srv/metadata.py | 8 +- src/calibre/srv/opds.py | 6 +- src/calibre/srv/opts.py | 4 +- src/calibre/srv/tests/ajax.py | 2 +- src/calibre/srv/tests/auth.py | 18 +- src/calibre/srv/tests/base.py | 2 +- src/calibre/srv/tests/http.py | 8 +- src/calibre/srv/tests/loop.py | 2 +- src/calibre/utils/bibtex.py | 2 +- src/calibre/utils/complete.py | 2 +- src/calibre/utils/config_base.py | 2 +- src/calibre/utils/copy_files.py | 2 +- src/calibre/utils/fonts/sfnt/cmap.py | 2 +- src/calibre/utils/fonts/sfnt/container.py | 26 +- src/calibre/utils/fonts/sfnt/head.py | 40 +- src/calibre/utils/fonts/sfnt/metrics.py | 2 +- src/calibre/utils/fonts/sfnt/subset.py | 4 +- src/calibre/utils/formatter.py | 6 +- src/calibre/utils/formatter_functions.py | 4 +- src/calibre/utils/icu.py | 2 +- src/calibre/utils/img.py | 2 +- src/calibre/utils/ipc/launch.py | 16 +- src/calibre/utils/ipc/pool.py | 2 +- src/calibre/utils/ipc/server.py | 2 +- src/calibre/utils/ipc/simple_worker.py | 8 +- src/calibre/utils/ipc/worker.py | 28 +- src/calibre/utils/localization.py | 14 +- src/calibre/utils/network.py | 6 +- src/calibre/utils/open_with/linux.py | 2 +- src/calibre/utils/opensearch/query.py | 2 +- src/calibre/utils/search_query_parser.py | 10 +- src/calibre/utils/search_query_parser_test.py | 18 +- src/calibre/utils/seven_zip.py | 2 +- src/calibre/utils/shared_file.py | 6 +- src/calibre/utils/smtp.py | 2 +- src/calibre/utils/smtplib.py | 6 +- src/calibre/utils/speedups.py | 2 +- src/calibre/utils/terminal.py | 2 +- src/calibre/utils/wmf/emf.py | 20 +- src/calibre/utils/wordcount.py | 2 +- src/calibre/utils/zipfile.py | 4 +- src/calibre/web/feeds/news.py | 6 +- src/calibre/web/feeds/recipes/collection.py | 10 +- src/calibre/web/feeds/templates.py | 4 +- src/odf/attrconverters.py | 4 +- src/odf/element.py | 8 +- src/odf/grammar.py | 1132 ++++++++--------- src/odf/odf2xhtml.py | 38 +- src/odf/odfmanifest.py | 4 +- src/odf/opendocument.py | 14 +- src/odf/teletype.py | 2 +- 386 files changed, 2666 insertions(+), 2679 deletions(-) diff --git a/recipes/1843.recipe b/recipes/1843.recipe index 4c5a016581..252f36d1c6 100644 --- a/recipes/1843.recipe +++ b/recipes/1843.recipe @@ -61,7 +61,7 @@ if use_archive: data = json.loads(raw) body = root.xpath('//body')[0] article = E(body, 'article') - E(article, 'div', data['flyTitle'] , style='color: red; font-size:small; font-weight:bold;') + E(article, 'div', data['flyTitle'], style='color: red; font-size:small; font-weight:bold;') E(article, 'h1', data['title'], title=safe_dict(data, 'url', 'canonical') or '') E(article, 'div', data['rubric'], style='font-style: italic; color:#202020;') try: @@ -96,7 +96,7 @@ else: for child in tuple(body): body.remove(child) article = E(body, 'article') - E(article, 'div', replace_entities(data['subheadline']) , style='color: red; font-size:small; font-weight:bold;') + E(article, 'div', replace_entities(data['subheadline']), style='color: red; font-size:small; font-weight:bold;') E(article, 'h1', replace_entities(data['headline'])) E(article, 'div', replace_entities(data['description']), style='font-style: italic; color:#202020;') if data['dateline'] is None: diff --git a/recipes/aktualne.cz.recipe b/recipes/aktualne.cz.recipe index ed1d647b8b..d1a8701769 100644 --- a/recipes/aktualne.cz.recipe +++ b/recipes/aktualne.cz.recipe @@ -32,7 +32,7 @@ class aktualneRecipe(BasicNewsRecipe): remove_attributes = [] remove_tags_before = dict(name='h1', attrs={'class': ['titulek-clanku']}) filter_regexps = [r'img.aktualne.centrum.cz'] - remove_tags = [dict(name='div', attrs={'id': ['social-bookmark']}), + remove_tags = [dict(name='div', attrs={'id': ['social-bookmark']}), dict(name='div', attrs={'class': ['box1', 'svazane-tagy']}), dict(name='div', attrs={'class': 'itemcomment id0'}), dict(name='div', attrs={'class': 'hlavicka'}), diff --git a/recipes/al_jazeera.recipe b/recipes/al_jazeera.recipe index 20817e7ca9..0e94bdc5dd 100644 --- a/recipes/al_jazeera.recipe +++ b/recipes/al_jazeera.recipe @@ -55,7 +55,7 @@ class AlJazeera(BasicNewsRecipe): u'http://www.aljazeera.com/xml/rss/all.xml')] def get_article_url(self, article): - artlurl = article.get('link', None) + artlurl = article.get('link', None) return artlurl def preprocess_html(self, soup): diff --git a/recipes/am730.recipe b/recipes/am730.recipe index bf8b3c1ded..9b87b779a4 100644 --- a/recipes/am730.recipe +++ b/recipes/am730.recipe @@ -58,7 +58,7 @@ class AM730(BasicNewsRecipe): articles = [] for aTag in soup.findAll('a',attrs={'class':'newsimglink'}): href = aTag.get('href',False) - if not href.encode('utf-8').startswith(url.encode('utf-8')) : + if not href.encode('utf-8').startswith(url.encode('utf-8')): continue # not in same section title = href.split('/')[-1].split('-')[0] diff --git a/recipes/barrons.recipe b/recipes/barrons.recipe index 898abe230b..007605fd0e 100644 --- a/recipes/barrons.recipe +++ b/recipes/barrons.recipe @@ -119,7 +119,7 @@ class barrons(BasicNewsRecipe): byl = articles.find(**prefixed_classes('BarronsTheme--byline--')) if byl: desc += self.tag_to_string(byl) - ttr = articles.find(**prefixed_classes('BarronsTheme--time-to-read--')) + ttr = articles.find(**prefixed_classes('BarronsTheme--time-to-read--')) if ttr: desc += self.tag_to_string(ttr) summ = articles.find(**prefixed_classes('BarronsTheme--summary--')) diff --git a/recipes/before_we_go.recipe b/recipes/before_we_go.recipe index 8423a69af2..cb0516083c 100644 --- a/recipes/before_we_go.recipe +++ b/recipes/before_we_go.recipe @@ -26,7 +26,7 @@ class BeforeWeGo(BasicNewsRecipe): remove_tags_after = dict(name='div', attrs={'id': 'author-bio'}) # remove_tags_after = dict(name='article') - remove_tags = [ + remove_tags = [ dict(name='div', attrs={'class': 'nectar-scrolling-text font_size_10vh custom_color has-custom-divider'}), dict(name='span', attrs={'class': 'meta-comment-count'}), dict(name='p', attrs={'id': 'breadcrumbs'}) diff --git a/recipes/blesk.recipe b/recipes/blesk.recipe index 0b3380ea60..3a50ee8b8b 100644 --- a/recipes/blesk.recipe +++ b/recipes/blesk.recipe @@ -33,9 +33,9 @@ class bleskRecipe(BasicNewsRecipe): remove_attributes = [] remove_tags_before = dict(name='div', attrs={'id': ['boxContent']}) remove_tags_after = dict(name='div', attrs={'class': ['artAuthors']}) - remove_tags = [dict(name='div', attrs={'class': ['link_clanek']}), - dict(name='div', attrs={'id': ['partHeader']}), - dict(name='div', attrs={'id': ['top_bottom_box', 'lista_top']})] + remove_tags = [dict(name='div', attrs={'class': ['link_clanek']}), + dict(name='div', attrs={'id': ['partHeader']}), + dict(name='div', attrs={'id': ['top_bottom_box', 'lista_top']})] preprocess_regexps = [(re.compile(r'
\n' + image + imagecap + body\ + '' return html diff --git a/recipes/irish_times.recipe b/recipes/irish_times.recipe index 90cbdd1a87..9f0637435e 100644 --- a/recipes/irish_times.recipe +++ b/recipes/irish_times.recipe @@ -121,7 +121,7 @@ class IrishTimes(BasicNewsRecipe): 'sec-fetch-site': 'same-origin', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', - }, data=urlencode({'username': self.username, 'password': self.password, 'deviceid':deviceid, 'persistent':'on', 'rid': ''})) + }, data=urlencode({'username': self.username, 'password': self.password, 'deviceid':deviceid, 'persistent':'on', 'rid': ''})) r = br.open(rq) raw = r.read() diff --git a/recipes/jot_down.recipe b/recipes/jot_down.recipe index b1b9deccd7..b078edd90c 100644 --- a/recipes/jot_down.recipe +++ b/recipes/jot_down.recipe @@ -47,7 +47,7 @@ class jotdown(BasicNewsRecipe): dict(name='div', attrs={'id':'respond'}) ] - remove_tags_after = dict(name='div' , attrs={'id':'respond'}) + remove_tags_after = dict(name='div', attrs={'id':'respond'}) preprocess_regexps = [ # To change the small size of the text diff --git a/recipes/kompiutierra.recipe b/recipes/kompiutierra.recipe index d34a60b365..6e2064ddb1 100644 --- a/recipes/kompiutierra.recipe +++ b/recipes/kompiutierra.recipe @@ -26,7 +26,7 @@ class Computerra(BasicNewsRecipe): remove_tags_after = dict(name='article') - remove_tags = [ + remove_tags = [ dict(name='ul', attrs={'class': 'breadcrumbs'}), dict(name='div', attrs={'class': 'post-info__likes post-info-likes'}), dict(name='div', attrs={'class': 'cta-row'}), diff --git a/recipes/kudy_z_nudy.recipe b/recipes/kudy_z_nudy.recipe index 963d3185a9..29aa54e224 100644 --- a/recipes/kudy_z_nudy.recipe +++ b/recipes/kudy_z_nudy.recipe @@ -30,7 +30,7 @@ class kudyznudyRecipe(BasicNewsRecipe): name='div', attrs={'class': ['C_WholeContentPadding']}) remove_tags_after = dict( name='div', attrs={'class': ['SurroundingsContainer']}) - remove_tags = [dict(name='div', attrs={ + remove_tags = [dict(name='div', attrs={ 'class': ['Details', 'buttons', 'SurroundingsContainer', 'breadcrumb']})] keep_only_tags = [] diff --git a/recipes/la_jornada.recipe b/recipes/la_jornada.recipe index ea13c1cf7d..355d6a6017 100644 --- a/recipes/la_jornada.recipe +++ b/recipes/la_jornada.recipe @@ -111,7 +111,7 @@ class LaJornada_mx(BasicNewsRecipe): def get_article_url(self, article): # Get link to original article URL - rurl = article.get('guid', None) + rurl = article.get('guid', None) if not rurl: # Use the "link" attribute as failover return article.get('link', None) diff --git a/recipes/libertad_digital.recipe b/recipes/libertad_digital.recipe index b3a571345b..834166e00c 100644 --- a/recipes/libertad_digital.recipe +++ b/recipes/libertad_digital.recipe @@ -50,7 +50,7 @@ class LibertadDigital(BasicNewsRecipe): ] def get_article_url(self, article): - return article.get('guid', None) + return article.get('guid', None) def print_version(self, url): art, sep, rest = url.rpartition('/') diff --git a/recipes/lrb.recipe b/recipes/lrb.recipe index 01e958e83c..37b1150608 100644 --- a/recipes/lrb.recipe +++ b/recipes/lrb.recipe @@ -12,7 +12,7 @@ def classes(classes): def absolutize(href): if href.startswith('/'): - href = 'https://www.lrb.co.uk' + href + href = 'https://www.lrb.co.uk' + href return href diff --git a/recipes/marca.recipe b/recipes/marca.recipe index 0235ce8ff4..48c0b436f0 100644 --- a/recipes/marca.recipe +++ b/recipes/marca.recipe @@ -46,4 +46,4 @@ class Marca(BasicNewsRecipe): return soup def get_article_url(self, article): - return article.get('guid', None) + return article.get('guid', None) diff --git a/recipes/mediapart.recipe b/recipes/mediapart.recipe index a69df9fb41..9aa66689c6 100644 --- a/recipes/mediapart.recipe +++ b/recipes/mediapart.recipe @@ -95,7 +95,7 @@ class Mediapart(BasicNewsRecipe): for feed in feeds: feed_name = feed.title.lower() for article in feed.articles: - if feed_name != 'autres' and feed_name not in article.url: + if feed_name != 'autres' and feed_name not in article.url: feed.articles.remove(article) if feed_name == 'autres' and any(section in article.url for section in self.sections): feed.articles.remove(article) diff --git a/recipes/montreal_gazette.recipe b/recipes/montreal_gazette.recipe index 1ae5c6743a..bb8b4b25eb 100644 --- a/recipes/montreal_gazette.recipe +++ b/recipes/montreal_gazette.recipe @@ -214,7 +214,7 @@ class CanWestPaper(BasicNewsRecipe): divtags = soup.findAll('div', attrs={'id': ''}) if divtags: for div in divtags: - del (div['id']) + del div['id'] pgall = soup.find('div', attrs={'id': 'storyphoto'}) if pgall is not None: # photo gallery perhaps diff --git a/recipes/moscowtimes_en.recipe b/recipes/moscowtimes_en.recipe index 6045055486..8ab1832838 100644 --- a/recipes/moscowtimes_en.recipe +++ b/recipes/moscowtimes_en.recipe @@ -22,7 +22,7 @@ class MoscowTimes(BasicNewsRecipe): remove_tags_after = dict(name='div', attrs={'class': 'article__tags'}) - remove_tags = [ + remove_tags = [ dict(name='aside'), dict(name='footer'), dict(name='section', attrs={'class': 'cluster'}), diff --git a/recipes/naszdziennik.recipe b/recipes/naszdziennik.recipe index c88a89e4aa..4868171f2d 100644 --- a/recipes/naszdziennik.recipe +++ b/recipes/naszdziennik.recipe @@ -60,7 +60,7 @@ class naszdziennik(BasicNewsRecipe): article_title_datetime.find('h4')) # zebrane elementy dodajemy do listy zadeklarowanej w linijce 44 articles[section].append( - {'title': article_title, 'url': article_url, 'date': article_date}) + {'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 for section in sections: diff --git a/recipes/navy_times.recipe b/recipes/navy_times.recipe index bd3f297e65..021b3ca26d 100644 --- a/recipes/navy_times.recipe +++ b/recipes/navy_times.recipe @@ -27,12 +27,12 @@ class NavyTimes(BasicNewsRecipe): ('Home page', 'https://www.navytimes.com/arc/outboundfeeds/rss/?outputType=xml'), ('News', 'https://www.navytimes.com/arc/outboundfeeds/rss/category/news/?outputType=xml'), ('Your Navy', 'https://www.navytimes.com/arc/outboundfeeds/rss/category/news/your-navy/?outputType=xml'), - ('Your Army', 'https://www.armytimes.com/arc/outboundfeeds/rss/category/news/your-army/?outputType=xml'), + ('Your Army', 'https://www.armytimes.com/arc/outboundfeeds/rss/category/news/your-army/?outputType=xml'), ('Your Air Force', 'https://www.airforcetimes.com/arc/outboundfeeds/rss/category/news/your-air-force?outputType=xml'), - ('Your Marine Core', 'https://www.marinecorpstimes.com/arc/outboundfeeds/rss/category/news/your-marine-corps/?outputType=xml'), - ('Pentagon and Congress', 'https://www.navytimes.com/arc/outboundfeeds/rss/category/news/pentagon-congress/?outputType=xml'), - ('Pay and Benefits', 'https://www.navytimes.com/arc/outboundfeeds/rss/category/pay-benefits/?outputType=xml'), - ('Veterans', 'https://www.navytimes.com/arc/outboundfeeds/rss/category/veterans/?outputType=xml'), - ('Education and Transition', 'https://www.navytimes.com/arc/outboundfeeds/rss/category/education-transition/?outputType=xml'), - ('Flashpoints', 'https://www.navytimes.com/arc/outboundfeeds/rss/category/flashpoints/?outputType=xml'), + ('Your Marine Core', 'https://www.marinecorpstimes.com/arc/outboundfeeds/rss/category/news/your-marine-corps/?outputType=xml'), + ('Pentagon and Congress', 'https://www.navytimes.com/arc/outboundfeeds/rss/category/news/pentagon-congress/?outputType=xml'), + ('Pay and Benefits', 'https://www.navytimes.com/arc/outboundfeeds/rss/category/pay-benefits/?outputType=xml'), + ('Veterans', 'https://www.navytimes.com/arc/outboundfeeds/rss/category/veterans/?outputType=xml'), + ('Education and Transition', 'https://www.navytimes.com/arc/outboundfeeds/rss/category/education-transition/?outputType=xml'), + ('Flashpoints', 'https://www.navytimes.com/arc/outboundfeeds/rss/category/flashpoints/?outputType=xml'), ] diff --git a/recipes/nepszabadsag.recipe b/recipes/nepszabadsag.recipe index a0b9f5279d..51612d42b8 100644 --- a/recipes/nepszabadsag.recipe +++ b/recipes/nepszabadsag.recipe @@ -29,7 +29,7 @@ class nepszabadsag(BasicNewsRecipe): remove_attributes = [] remove_tags_before = dict(name='div', attrs={'class': ['d-source']}) remove_tags_after = dict(name='div', attrs={'class': ['tags']}) - remove_tags = [dict(name='div', attrs={'class': ['h']}), + remove_tags = [dict(name='div', attrs={'class': ['h']}), dict(name='tfoot')] keep_only_tags = [dict(name='table', attrs={'class': 'article-box'})] diff --git a/recipes/nikkei_news.recipe b/recipes/nikkei_news.recipe index afc88e86ec..7c4f02cfb6 100644 --- a/recipes/nikkei_news.recipe +++ b/recipes/nikkei_news.recipe @@ -80,7 +80,7 @@ class NikkeiNet_paper_subscription(BasicNewsRecipe): sections = soup.findAll(attrs={'class': re.compile(r'.*cmn-article_title.*')}) for sect in sections: - sect_title = sect.find(attrs={'class' : re.compile(r'.*cmnc-((large)|(middle)|(small)).*')}) + sect_title = sect.find(attrs={'class': re.compile(r'.*cmnc-((large)|(middle)|(small)).*')}) if sect_title is None: continue sect_title = sect_title.contents[0] diff --git a/recipes/novinky.cz.recipe b/recipes/novinky.cz.recipe index c30dc259d7..e131e798e8 100644 --- a/recipes/novinky.cz.recipe +++ b/recipes/novinky.cz.recipe @@ -24,12 +24,12 @@ class novinkyRecipe(BasicNewsRecipe): remove_javascript = True no_stylesheets = True - remove_tags = [dict(name='div', attrs={'id': ['pictureInnerBox']}), - dict(name='div', attrs={'id': ['discussionEntry']}), - dict(name='span', attrs={ + remove_tags = [dict(name='div', attrs={'id': ['pictureInnerBox']}), + dict(name='div', attrs={'id': ['discussionEntry']}), + dict(name='span', attrs={ 'id': ['mynews-hits', 'mynews-author']}), - dict(name='div', attrs={'class': ['related']}), - dict(name='div', attrs={'id': ['multimediaInfo']})] + dict(name='div', attrs={'class': ['related']}), + dict(name='div', attrs={'id': ['multimediaInfo']})] remove_tags_before = dict(name='div', attrs={'class': ['articleHeader']}) remove_tags_after = dict(name='div', attrs={'class': 'related'}) diff --git a/recipes/nu.recipe b/recipes/nu.recipe index 80dd9a19f0..a40d392304 100644 --- a/recipes/nu.recipe +++ b/recipes/nu.recipe @@ -49,4 +49,4 @@ class Nu(BasicNewsRecipe): (u'Podcast Algemeen nieuws', u'http://www.nu.nl/podcast.php')] def get_article_url(self, article): - return article.get('guid', None) + return article.get('guid', None) diff --git a/recipes/old_games.recipe b/recipes/old_games.recipe index a7e3655e1f..508eba0a85 100644 --- a/recipes/old_games.recipe +++ b/recipes/old_games.recipe @@ -24,7 +24,7 @@ class OGRU(BasicNewsRecipe): remove_attributes = ['style'] - remove_tags = [ + remove_tags = [ dict(name='p', attrs={'id': 'pageDescription'}), dict(name='div', attrs={'class': 'pageNavLinkGroup'}), dict(name='div', attrs={'class': 'tagBlock TagContainer'}), diff --git a/recipes/ottawa_citizen.recipe b/recipes/ottawa_citizen.recipe index 68342217d5..9db1eb7c04 100644 --- a/recipes/ottawa_citizen.recipe +++ b/recipes/ottawa_citizen.recipe @@ -214,7 +214,7 @@ class CanWestPaper(BasicNewsRecipe): divtags = soup.findAll('div', attrs={'id': ''}) if divtags: for div in divtags: - del (div['id']) + del div['id'] pgall = soup.find('div', attrs={'id': 'storyphoto'}) if pgall is not None: # photo gallery perhaps diff --git a/recipes/pagina12.recipe b/recipes/pagina12.recipe index 0bff247ba1..3276fa4c7f 100644 --- a/recipes/pagina12.recipe +++ b/recipes/pagina12.recipe @@ -76,22 +76,22 @@ class Pagina12(BasicNewsRecipe): return br feeds = [ - (u'Diario de hoy' , u'https://www.pagina12.com.ar/rss/edicion-impresa'), - (u'Espectaculos' , u'https://www.pagina12.com.ar/rss/suplementos/cultura-y-espectaculos/notas'), - (u'Radar' , u'https://www.pagina12.com.ar/rss/suplementos/radar/notas'), - (u'Radar libros' , u'https://www.pagina12.com.ar/rss/suplementos/radar-libros/notas'), - (u'Cash' , u'https://www.pagina12.com.ar/rss/suplementos/cash/notas'), - (u'NO' , u'https://www.pagina12.com.ar/rss/suplementos/no/notas'), - (u'Las 12' , u'https://www.pagina12.com.ar/rss/suplementos/las12/notas'), - (u'Soy' , u'https://www.pagina12.com.ar/rss/suplementos/soy/notas'), - (u'M2' , u'https://www.pagina12.com.ar/rss/suplementos/m2/notas'), - (u'Rosario 12' , u'https://www.pagina12.com.ar/rss/suplementos/rosario12/notas') + (u'Diario de hoy', u'https://www.pagina12.com.ar/rss/edicion-impresa'), + (u'Espectaculos', u'https://www.pagina12.com.ar/rss/suplementos/cultura-y-espectaculos/notas'), + (u'Radar', u'https://www.pagina12.com.ar/rss/suplementos/radar/notas'), + (u'Radar libros', u'https://www.pagina12.com.ar/rss/suplementos/radar-libros/notas'), + (u'Cash', u'https://www.pagina12.com.ar/rss/suplementos/cash/notas'), + (u'NO', u'https://www.pagina12.com.ar/rss/suplementos/no/notas'), + (u'Las 12', u'https://www.pagina12.com.ar/rss/suplementos/las12/notas'), + (u'Soy', u'https://www.pagina12.com.ar/rss/suplementos/soy/notas'), + (u'M2', u'https://www.pagina12.com.ar/rss/suplementos/m2/notas'), + (u'Rosario 12', u'https://www.pagina12.com.ar/rss/suplementos/rosario12/notas') ] def get_cover_url(self): lurl = strftime('https://www.pagina12.com.ar/edicion-impresa/%d-%m-%Y') soup = self.index_to_soup(lurl) - mydiv = soup.find('div', {'class' : lambda x: x and 'printed-edition-cover' in x.split()}) + mydiv = soup.find('div', {'class': lambda x: x and 'printed-edition-cover' in x.split()}) if mydiv: for image in mydiv.findAll('img'): if image['src'].startswith('https://images.pagina12.com.ar/styles/width700/public/'): diff --git a/recipes/paperpaper.recipe b/recipes/paperpaper.recipe index 73d5c7daed..5bb6705753 100644 --- a/recipes/paperpaper.recipe +++ b/recipes/paperpaper.recipe @@ -24,7 +24,7 @@ class PaperPaper(BasicNewsRecipe): remove_tags_after = dict(name='article') - remove_tags = [ + remove_tags = [ dict(name='div', attrs={'class': 'bottom-block '}), dict(name='div', attrs={'class': 'bottom-block news'}) ] diff --git a/recipes/parlamentni_listy.recipe b/recipes/parlamentni_listy.recipe index 27bd17b4e3..adcfc3b259 100644 --- a/recipes/parlamentni_listy.recipe +++ b/recipes/parlamentni_listy.recipe @@ -32,4 +32,4 @@ class plRecipe(BasicNewsRecipe): preprocess_regexps = [(re.compile(r'<(span|strong)[^>]*>\s*Ptejte se politik.*', re.DOTALL | re.IGNORECASE), lambda match: '