From fb0a290127d7ce136829aeaa8a1eff339b70aa3f Mon Sep 17 00:00:00 2001 From: un-pogaz <46523284+un-pogaz@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:14:22 +0100 Subject: [PATCH] remove duplicate class field definition (manual) ruff 'PIE794' --- pyproject.toml | 3 ++- recipes/afr.recipe | 1 - recipes/albert_mohler.recipe | 1 - recipes/altomdata_dk.recipe | 1 - recipes/aprospect.recipe | 2 -- recipes/arbetaren.recipe | 4 +--- recipes/berfreunde_blog.recipe | 1 - recipes/business_standard_print.recipe | 2 -- recipes/calcalist.recipe | 2 -- recipes/canardpc.recipe | 1 - recipes/cbn.recipe | 1 - recipes/christian_post.recipe | 1 - recipes/colta.recipe | 1 - recipes/den_of_geek.recipe | 1 - recipes/descopera.recipe | 2 -- recipes/desiring_god.recipe | 1 - recipes/deutsche_welle_de.recipe | 2 -- recipes/dobreprogamy.recipe | 6 +----- recipes/economist_search.recipe | 4 +--- recipes/el_colombiano.recipe | 6 ++++-- recipes/el_correo.recipe | 9 --------- recipes/eso_pl.recipe | 8 ++++---- recipes/fairbanks_daily.recipe | 1 - recipes/faz_net.recipe | 3 +-- recipes/gates_notes.recipe | 1 - recipes/glasgow_herald.recipe | 1 - recipes/hannoversche_zeitung.recipe | 3 +-- recipes/harpers.recipe | 1 - recipes/high_country_news.recipe | 4 +--- recipes/hna.recipe | 1 - recipes/in_gr.recipe | 1 - recipes/independent.recipe | 1 - recipes/independent_australia.recipe | 9 --------- recipes/inquirer_net.recipe | 3 --- recipes/jpost.recipe | 1 - recipes/kosmonauta_pl.recipe | 1 - recipes/le_monde.recipe | 1 - recipes/lwn.recipe | 1 - recipes/mateusz_czytania.recipe | 1 - recipes/modoros.recipe | 1 - recipes/myapple_pl.recipe | 1 - recipes/natgeo.recipe | 4 ++-- recipes/natgeo_kids.recipe | 4 ++-- recipes/natgeo_traveller.recipe | 4 ++-- recipes/natgeohis.recipe | 8 +++----- recipes/natgeomag.recipe | 4 ++-- recipes/nme.recipe | 1 - recipes/novinite_bg.recipe | 6 ++++-- recipes/nytimes_sports.recipe | 1 - recipes/optyczne_pl.recipe | 1 - recipes/orfonline.recipe | 1 - recipes/people_daily.recipe | 1 - recipes/ppe_pl.recipe | 1 - recipes/readers_digest.recipe | 1 - recipes/skai.recipe | 1 - recipes/theoldie.recipe | 2 +- recipes/usatoday.recipe | 1 - recipes/walla.recipe | 1 - recipes/woz_die.recipe | 8 +++++--- ruff-strict-pep8.toml | 3 ++- src/calibre/devices/mtp/driver.py | 1 - src/calibre/gui2/viewer/web_view.py | 2 -- 62 files changed, 39 insertions(+), 113 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fd908ac9d7..c6bc3082fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,8 @@ quote-style = 'single' [tool.ruff.lint] ignore = ['E402', 'E722', 'E741'] -select = ['E', 'F', 'I', 'W', 'INT'] +select = ['E', 'F', 'I', 'W', 'INT', 'PIE794'] +unfixable = ['PIE794'] [tool.ruff.lint.per-file-ignores] "src/calibre/ebooks/unihandecode/*codepoints.py" = ['E501'] diff --git a/recipes/afr.recipe b/recipes/afr.recipe index cbba5b9817..000d83f66a 100644 --- a/recipes/afr.recipe +++ b/recipes/afr.recipe @@ -25,7 +25,6 @@ class afr(BasicNewsRecipe): timefmt = ' [%d %b %Y]' max_articles_per_feed = 25 no_stylesheets = True - remove_empty_feeds = True remove_attributes = ['style', 'height', 'width'] keep_only_tags = [ diff --git a/recipes/albert_mohler.recipe b/recipes/albert_mohler.recipe index f92c54a9db..6babd67c0f 100644 --- a/recipes/albert_mohler.recipe +++ b/recipes/albert_mohler.recipe @@ -13,7 +13,6 @@ class AlbertMohlersBlog(BasicNewsRecipe): auto_cleanup = True cover_url = 'http://www.albertmohler.com/wp-content/themes/albert-mohler-v5/img/logo-am-lg.gif' publisher = 'Albert Mohler' - language = 'en' author = 'Albert Mohler' feeds = [(u"Albert Mohler's Blog", diff --git a/recipes/altomdata_dk.recipe b/recipes/altomdata_dk.recipe index 1f771e8d94..3dbdd41a0d 100644 --- a/recipes/altomdata_dk.recipe +++ b/recipes/altomdata_dk.recipe @@ -21,7 +21,6 @@ class WwwAltomdata_dk(BasicNewsRecipe): resolve_internal_links = True remove_empty_feeds = True auto_cleanup = True - language = 'da' feeds = [ ('Alt om DATA, Datatid TechLife', 'http://www.altomdata.dk/feed'), diff --git a/recipes/aprospect.recipe b/recipes/aprospect.recipe index de904a2dca..5de1cefe7d 100644 --- a/recipes/aprospect.recipe +++ b/recipes/aprospect.recipe @@ -19,8 +19,6 @@ class AmericanProspect(BasicNewsRecipe): use_embedded_content = False - no_stylesheets = True - keep_only_tags = [ dict(id=['title', 'content']), ] diff --git a/recipes/arbetaren.recipe b/recipes/arbetaren.recipe index e22ed5e23f..7e34597917 100644 --- a/recipes/arbetaren.recipe +++ b/recipes/arbetaren.recipe @@ -18,8 +18,6 @@ class Arbetaren_SE(BasicNewsRecipe): encoding = 'utf-8' language = 'sv' auto_cleanup = True - auto_cleanup_keep = '//div[@class="thumbnail"]' - auto_cleanup_keep = '//div[@id="article-image"]' - auto_cleanup_keep = '//div[@id="article-image"]|//span[@class="important"]' + auto_cleanup_keep = '//div[@class="thumbnail"]|//div[@id="article-image"]|//span[@class="important"]' feeds = [(u'Nyheter', u'https://www.arbetaren.se/feed')] diff --git a/recipes/berfreunde_blog.recipe b/recipes/berfreunde_blog.recipe index 997588ecd8..cebf908515 100644 --- a/recipes/berfreunde_blog.recipe +++ b/recipes/berfreunde_blog.recipe @@ -25,7 +25,6 @@ class bergfreunde_blog(BasicNewsRecipe): __author__ = 'VoHe' no_stylesheets = True remove_javascript = True - remove_javascript = True remove_empty_feeds = True ignore_duplicate_articles = {'title', 'url'} diff --git a/recipes/business_standard_print.recipe b/recipes/business_standard_print.recipe index eafe84282e..439284b28d 100644 --- a/recipes/business_standard_print.recipe +++ b/recipes/business_standard_print.recipe @@ -15,8 +15,6 @@ class BusinessStandardPrint(BasicNewsRecipe): language = 'en_IN' masthead_url = 'https://bsmedia.business-standard.com/include/_mod/site/html5/images/business-standard-logo.png' encoding = 'utf-8' - resolve_internal_links = True - remove_empty_feeds = True no_stylesheets = True remove_javascript = True diff --git a/recipes/calcalist.recipe b/recipes/calcalist.recipe index 933eddaf78..32f80cdb25 100644 --- a/recipes/calcalist.recipe +++ b/recipes/calcalist.recipe @@ -10,7 +10,6 @@ class AdvancedUserRecipe1283848012(BasicNewsRecipe): language = 'he' __author__ = 'marbs' extra_css = 'img {max-width:100%;} body{direction: rtl;},title{direction: rtl; } ,article_description{direction: rtl; }, a.article{direction: rtl; } ,calibre_feed_description{direction: rtl; }' # noqa: E501 - simultaneous_downloads = 5 remove_javascript = True timefmt = '[%a, %d %b, %Y]' oldest_article = 1 @@ -23,7 +22,6 @@ class AdvancedUserRecipe1283848012(BasicNewsRecipe): dict(name='div', attrs={'class': 'ArticleBodyComponent'}), ] remove_tags = [dict(name='p', attrs={'text': [' ']})] - max_articles_per_feed = 100 preprocess_regexps = [ (re.compile(r'

 

', re.DOTALL | re.IGNORECASE), lambda match: '') ] diff --git a/recipes/canardpc.recipe b/recipes/canardpc.recipe index be8a3267b4..839165dd63 100644 --- a/recipes/canardpc.recipe +++ b/recipes/canardpc.recipe @@ -4,7 +4,6 @@ from calibre.web.feeds.news import BasicNewsRecipe class AdvancedUserRecipe1271446252(BasicNewsRecipe): title = u'CanardPC' oldest_article = 7 - max_articles_per_feed = 100 language = 'fr' __author__ = 'zorgluf' max_articles_per_feed = 25 diff --git a/recipes/cbn.recipe b/recipes/cbn.recipe index 36a4f5a255..834f5d57ae 100644 --- a/recipes/cbn.recipe +++ b/recipes/cbn.recipe @@ -31,7 +31,6 @@ class CBN(BasicNewsRecipe): remove_javascript = True use_embedded_content = False no_stylesheets = True - language = 'en' encoding = 'iso-8859-1' conversion_options = {'linearize_tables': True} diff --git a/recipes/christian_post.recipe b/recipes/christian_post.recipe index e924984dac..9ab4a639d2 100644 --- a/recipes/christian_post.recipe +++ b/recipes/christian_post.recipe @@ -9,7 +9,6 @@ class ChristianPost(BasicNewsRecipe): __author__ = 'sexymax15' description = 'Homepage' language = 'en' - no_stylesheets = True use_embedded_content = False oldest_article = 30 max_articles_per_feed = 15 diff --git a/recipes/colta.recipe b/recipes/colta.recipe index ea86cda905..d2ce698c40 100644 --- a/recipes/colta.recipe +++ b/recipes/colta.recipe @@ -12,7 +12,6 @@ class Colta(BasicNewsRecipe): publisher = 'OpenSpace.ru' category = 'news' cover_url = u'http://www.colta.ru/assets/logo-afb684c3d35fc1f6f103f9fb638c8ec1.png' - language = 'ru' no_stylesheets = True remove_javascript = True diff --git a/recipes/den_of_geek.recipe b/recipes/den_of_geek.recipe index e084499942..4274a50737 100644 --- a/recipes/den_of_geek.recipe +++ b/recipes/den_of_geek.recipe @@ -7,7 +7,6 @@ class AdvancedUserRecipe1316944753(BasicNewsRecipe): language = 'en' description = 'From science fiction enthusiasts through to gaming fanatics, Den of Geek has become the one-stop UK website for people genuinely passionate about their entertainment media. Den of Geek covers popular culture but always with an edgy, UK centric slant that sets it apart from the crowd.' # noqa: E501 category = 'Movies, TV, Games, Comics, Cult, News, Reviews' - language = 'en' oldest_article = 7 max_articles_per_feed = 100 diff --git a/recipes/descopera.recipe b/recipes/descopera.recipe index 3186b28ecb..949dc006a9 100644 --- a/recipes/descopera.recipe +++ b/recipes/descopera.recipe @@ -18,12 +18,10 @@ class Descopera(BasicNewsRecipe): oldest_article = 5 language = 'ro' max_articles_per_feed = 100 - no_stylesheets = True use_embedded_content = False category = 'Ziare,Reviste,Descopera' encoding = 'utf-8' cover_url = 'http://www.descopera.ro/images/header_images/logo.gif' - use_embedded_content = False no_stylesheets = True auto_cleanup = True diff --git a/recipes/desiring_god.recipe b/recipes/desiring_god.recipe index bd287217ef..579ce6d873 100644 --- a/recipes/desiring_god.recipe +++ b/recipes/desiring_god.recipe @@ -11,7 +11,6 @@ class DesiringGodEnglish(BasicNewsRecipe): cover_url = 'http://cdn0.desiringgod.org/images/layout/breadcrumbs_dg_mark.png' masthead_url = 'http://cdn0.desiringgod.org/images/layout/breadcrumbs_dg_mark.png' - language = 'en' oldest_article = 7 max_articles_per_feed = 50 auto_cleanup = True diff --git a/recipes/deutsche_welle_de.recipe b/recipes/deutsche_welle_de.recipe index 985b43e59c..b70b58fb9f 100644 --- a/recipes/deutsche_welle_de.recipe +++ b/recipes/deutsche_welle_de.recipe @@ -11,8 +11,6 @@ class DeutscheWelle(BasicNewsRecipe): max_articles_per_feed = 200 no_stylesheets = True remove_javascript = True - no_stylesheets = True - remove_javascript = True remove_empty_feeds = True ignore_duplicate_articles = {'title', 'url'} remove_attributes = ['height', 'width', 'style'] diff --git a/recipes/dobreprogamy.recipe b/recipes/dobreprogamy.recipe index 2d454553d0..b9b7bfa220 100644 --- a/recipes/dobreprogamy.recipe +++ b/recipes/dobreprogamy.recipe @@ -15,7 +15,7 @@ class Dobreprogramy_pl(BasicNewsRecipe): index = 'http://www.dobreprogramy.pl/' no_stylesheets = True language = 'pl' - extra_css = '.title {font-size:22px;}' + extra_css = '.title {font-size:22px;}, h1 { font-size:130% }' oldest_article = 8 max_articles_per_feed = 100 remove_attrs = ['style', 'width', 'height'] @@ -41,7 +41,3 @@ class Dobreprogramy_pl(BasicNewsRecipe): if not r.string: r.extract() return soup - - extra_css = ''' - h1 { font-size:130% } - ''' diff --git a/recipes/economist_search.recipe b/recipes/economist_search.recipe index c6ca84f630..b8ad8dfb97 100644 --- a/recipes/economist_search.recipe +++ b/recipes/economist_search.recipe @@ -121,7 +121,7 @@ class econ_search(BasicNewsRecipe): 'Use the Advanced section of the recipe to search.' ) - remove_attributes = ['style', 'height', 'width'] + remove_attributes = ['data-reactid', 'style', 'height', 'width'] no_stylesheets = True ignore_duplicate_articles = {'url'} extra_css = ''' @@ -154,8 +154,6 @@ class econ_search(BasicNewsRecipe): ) ] keep_only_tags = [dict(name='article', id=lambda x: not x)] - no_stylesheets = True - remove_attributes = ['data-reactid', 'width', 'height'] # economist.com has started throttling after about 60% of the total has # downloaded with connection reset by peer (104) errors. delay = 3 diff --git a/recipes/el_colombiano.recipe b/recipes/el_colombiano.recipe index 81c888bff9..3a39cb0fbb 100644 --- a/recipes/el_colombiano.recipe +++ b/recipes/el_colombiano.recipe @@ -9,8 +9,10 @@ class AdvancedUserRecipe1311790237(BasicNewsRecipe): language = 'es_CO' cover_url = 'http://www.elcolombiano.com/images/logoElColombiano348x46.gif' remove_tags_before = dict(id='contenidoArt') - remove_tags_after = dict(id='enviaTips') - remove_tags_after = dict(id='zonaPata') + remove_tags_after = [ + dict(id='enviaTips'), + dict(id='zonaPata'), + ] oldest_article = 1 max_articles_per_feed = 100 remove_javascript = True diff --git a/recipes/el_correo.recipe b/recipes/el_correo.recipe index 63d05274ba..c364abeee4 100644 --- a/recipes/el_correo.recipe +++ b/recipes/el_correo.recipe @@ -18,7 +18,6 @@ class elcorreo(BasicNewsRecipe): ignore_duplicate_articles = {'url'} encoding = 'utf-8' masthead_url = 'https://s1.ppllstatics.com/starfish/1.3.76/assets/images/logos/logo-elcorreo.svg' - encoding = 'utf-8' remove_empty_feeds = True resolve_internal_links = True max_articles_per_feed = 25 # articles @@ -88,14 +87,6 @@ class elcorreo(BasicNewsRecipe): p.name = 'div' return soup - recipe_specific_options = { - 'days': { - 'short': 'Oldest article to download from this news source. In days ', - 'long': 'For example, 0.5, gives you articles from the past 12 hours', - 'default': str(oldest_article) - } - } - def get_browser(self, *args, **kwargs): kwargs['user_agent'] = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)' br = BasicNewsRecipe.get_browser(self, *args, **kwargs) diff --git a/recipes/eso_pl.recipe b/recipes/eso_pl.recipe index e4e1143c7f..5f0dbb5456 100644 --- a/recipes/eso_pl.recipe +++ b/recipes/eso_pl.recipe @@ -13,7 +13,10 @@ class ESO(BasicNewsRecipe): remove_empty_feeds = True use_embedded_content = False cover_url = 'https://www.eso.org/public/archives/logos/medium/eso-logo-black-outline.jpg' - keep_only_tags = [dict(attrs={'class': 'subcl'})] + keep_only_tags = [ + dict(attrs={'class': 'subcl'}), + dict(name='div',attrs={'class':'col-md-9 left-column'}), + ] remove_tags = [dict(id='lang_row'), dict( attrs={'class': ['pr_typeid', 'pr_news_feature_link', 'outreach_usage', 'hidden']})] feeds = [ @@ -21,9 +24,6 @@ class ESO(BasicNewsRecipe): (u'Og\u0142oszenia', u'http://www.eso.org/public/poland/announcements/feed/'), (u'Zdj\u0119cie tygodnia', u'http://www.eso.org/public/poland/images/potw/feed/')] - keep_only_tags = [ - dict(name='div',attrs={'class':'col-md-9 left-column'})] - def preprocess_html(self, soup): for a in soup.findAll('a', href=True): if a['href'].startswith('/'): diff --git a/recipes/fairbanks_daily.recipe b/recipes/fairbanks_daily.recipe index 6435406cb5..f72f612891 100644 --- a/recipes/fairbanks_daily.recipe +++ b/recipes/fairbanks_daily.recipe @@ -13,7 +13,6 @@ class FairbanksDailyNewsminer(BasicNewsRecipe): remove_javascript = True use_embedded_content = False no_stylesheets = True - language = 'en' encoding = 'utf8' conversion_options = {'linearize_tables': True} auto_cleanup = True diff --git a/recipes/faz_net.recipe b/recipes/faz_net.recipe index c90eda7651..ae78d7a085 100644 --- a/recipes/faz_net.recipe +++ b/recipes/faz_net.recipe @@ -108,8 +108,7 @@ class FazNet(BasicNewsRecipe): scale_news_images = (10,100) delay = 1 - test_article = 'https://www.faz.net/rss/aktuell/feuilleton/kunst-und-architektur/berlinische-galerie-zeigt-edvard-munch-die-ganze-gefuehlsskala-des-lebens-19180631.html?printPagedArticle=true#pageIndex_2' - test_article = None + test_feed = 'https://www.faz.net/rss/aktuell/feuilleton/kunst-und-architektur/berlinische-galerie-zeigt-edvard-munch-die-ganze-gefuehlsskala-des-lebens-19180631.html?printPagedArticle=true#pageIndex_2' extra_css = ''' .header-title,.scrolly-title {font-size: 1.5em; font-weight:bold; text-align:left;} diff --git a/recipes/gates_notes.recipe b/recipes/gates_notes.recipe index 5b7844f819..40718e8cd2 100644 --- a/recipes/gates_notes.recipe +++ b/recipes/gates_notes.recipe @@ -8,7 +8,6 @@ class AdvancedUserRecipe1716089864(BasicNewsRecipe): description = 'The Blog of Bill Gates.' language = 'en' __author__ = 'Spicy Poison' - description = 'The Blog of Bill Gates' publisher = 'Bill Gates' oldest_article = 30 max_articles_per_feed = 50 diff --git a/recipes/glasgow_herald.recipe b/recipes/glasgow_herald.recipe index 388dff9783..fd48f22e84 100644 --- a/recipes/glasgow_herald.recipe +++ b/recipes/glasgow_herald.recipe @@ -11,7 +11,6 @@ class GlasgowHerald(BasicNewsRecipe): title = u'Glasgow Herald' oldest_article = 1 max_articles_per_feed = 100 - no_stylesheets = True language = 'en_GB' __author__ = 'Kovid Goyal' diff --git a/recipes/hannoversche_zeitung.recipe b/recipes/hannoversche_zeitung.recipe index 9a2525e09a..5b33cec208 100644 --- a/recipes/hannoversche_zeitung.recipe +++ b/recipes/hannoversche_zeitung.recipe @@ -29,9 +29,8 @@ class AdvancedUserRecipe1287519083(BasicNewsRecipe): remove_tags_before = dict(id='modul_artikel') remove_tags_after = dict(id='articlecontent') - remove_tags = dict(id='articlesidebar') - remove_tags = [ + dict(id='articlesidebar'), dict(name='div', attrs={'class': ['articlecomment', 'articlebookmark', 'teaser_anzeige', 'teaser_umfrage', 'navigation', 'subnavigation']}) diff --git a/recipes/harpers.recipe b/recipes/harpers.recipe index c372d55fdc..e8bd34366c 100644 --- a/recipes/harpers.recipe +++ b/recipes/harpers.recipe @@ -35,7 +35,6 @@ class Harpers(BasicNewsRecipe): remove_tags = [ classes('header-controls') ] - remove_attributes = ['style', 'width', 'height'] extra_css = ''' img {display:block; margin:0 auto;} diff --git a/recipes/high_country_news.recipe b/recipes/high_country_news.recipe index 277a516d3a..1972c58b9e 100644 --- a/recipes/high_country_news.recipe +++ b/recipes/high_country_news.recipe @@ -50,7 +50,7 @@ class HighCountryNews(BasicNewsRecipe): auto_cleanup = False remove_javascript = True remove_empty_feeds = True - remove_attributes = ['width', 'height'] + remove_attributes = ['style', 'width', 'height'] use_embedded_content = False masthead_url = 'http://www.hcn.org/logo.jpg' @@ -69,8 +69,6 @@ class HighCountryNews(BasicNewsRecipe): # caption and credit for description & author of pictures # main-topic - remove_attributes = ['style'] - extra_css = ''' h1 {font-size: 1.6em; text-align: left} h2 {font-size: 1em; font-style: italic; font-weight: normal} diff --git a/recipes/hna.recipe b/recipes/hna.recipe index 814476dd9e..d84df3b31d 100644 --- a/recipes/hna.recipe +++ b/recipes/hna.recipe @@ -13,7 +13,6 @@ class hnaDe(BasicNewsRecipe): title = 'HNA' description = 'local news from Hessen/Germany' __author__ = 'Oliver Niesner' - use_embedded_content = False language = 'de' use_embedded_content = False timefmt = ' [%d %b %Y]' diff --git a/recipes/in_gr.recipe b/recipes/in_gr.recipe index 2d76098fc4..7354d7cc18 100644 --- a/recipes/in_gr.recipe +++ b/recipes/in_gr.recipe @@ -14,7 +14,6 @@ class ingr(BasicNewsRecipe): no_stylesheets = True use_embedded_content = False remove_empty_feeds = True - encoding = 'utf8' keep_only_tags = [ dict(name='h1'), diff --git a/recipes/independent.recipe b/recipes/independent.recipe index 6076d506dd..fe2e5c3c69 100644 --- a/recipes/independent.recipe +++ b/recipes/independent.recipe @@ -30,7 +30,6 @@ class TheIndependentNew(BasicNewsRecipe): publisher = 'The Independent' oldest_article = 2.0 ignore_duplicate_articles = {'title', 'url'} - remove_empty_feeds = True category = 'news, UK' no_stylesheets = True use_embedded_content = False diff --git a/recipes/independent_australia.recipe b/recipes/independent_australia.recipe index d1fadf3a4a..f0968398dc 100644 --- a/recipes/independent_australia.recipe +++ b/recipes/independent_australia.recipe @@ -20,8 +20,6 @@ class IndependentAustralia(BasicNewsRecipe): description = ( 'Independent Australia is a progressive journal focusing on politics, democracy, the environment, Australian history and Australian identity.' ' It contains news and opinion from Australia and around the world.') - oldest_article = 7 # days - max_articles_per_feed = 100 feeds = [ ( @@ -67,13 +65,6 @@ class IndependentAustralia(BasicNewsRecipe): extra_css = '.byline{font-size:smaller;margin-bottom:10px;}.inline-caption{display:block;font-size:smaller;text-decoration: none;}' compress_news_images = True - feeds = [ - ( - 'Independent Australia', - 'https://feeds.feedburner.com/IndependentAustralia' - ), - ] - # ************************************ # Break up feed into categories (based on BrianG's code snippet): # ************************************ diff --git a/recipes/inquirer_net.recipe b/recipes/inquirer_net.recipe index 177a2d2fb3..00227b323f 100644 --- a/recipes/inquirer_net.recipe +++ b/recipes/inquirer_net.recipe @@ -15,7 +15,6 @@ class InquirerNet(BasicNewsRecipe): description = 'News from Philipines' oldest_article = 2 max_articles_per_feed = 100 - no_stylesheets = True use_embedded_content = False encoding = 'utf8' publisher = 'inquirer.net' @@ -23,8 +22,6 @@ class InquirerNet(BasicNewsRecipe): lang = 'en' language = 'en' - use_embedded_content = False - no_stylesheets = True auto_cleanup = True diff --git a/recipes/jpost.recipe b/recipes/jpost.recipe index 2c94daead2..ef8281a4cb 100644 --- a/recipes/jpost.recipe +++ b/recipes/jpost.recipe @@ -25,7 +25,6 @@ class JerusalemPost(BasicNewsRecipe): __author__ = 'Kovid Goyal' max_articles_per_feed = 10 - no_stylesheets = True def get_browser(self): return BasicNewsRecipe.get_browser(self, user_agent='common_words/based') diff --git a/recipes/kosmonauta_pl.recipe b/recipes/kosmonauta_pl.recipe index 2e7c23ac8f..a262723abb 100644 --- a/recipes/kosmonauta_pl.recipe +++ b/recipes/kosmonauta_pl.recipe @@ -10,7 +10,6 @@ class Kosmonauta(BasicNewsRecipe): category = 'astronomy' language = 'pl' cover_url = 'http://bi.gazeta.pl/im/4/10393/z10393414X,Kosmonauta-net.jpg' - no_stylesheets = True oldest_article = 7 no_stylesheets = True remove_javascript = True diff --git a/recipes/le_monde.recipe b/recipes/le_monde.recipe index ad5dcdb11c..ab4e9852c4 100644 --- a/recipes/le_monde.recipe +++ b/recipes/le_monde.recipe @@ -27,7 +27,6 @@ class LeMonde(BasicNewsRecipe): oldest_article = 1 no_stylesheets = True - remove_empty_feeds = True ignore_duplicate_articles = {'title', 'url'} reverse_article_order = True remove_empty_feeds = True diff --git a/recipes/lwn.recipe b/recipes/lwn.recipe index cee5c92b3f..e21efdfb33 100644 --- a/recipes/lwn.recipe +++ b/recipes/lwn.recipe @@ -14,7 +14,6 @@ class LWN(BasicNewsRecipe): __author__ = 'Oliver Niesner' description = 'Linux Weekly News' oldest_article = 54 - language = _('English') max_articles_per_feed = 100 needs_subscription = True language = 'en' diff --git a/recipes/mateusz_czytania.recipe b/recipes/mateusz_czytania.recipe index 9717176efb..4a40aeb1f3 100644 --- a/recipes/mateusz_czytania.recipe +++ b/recipes/mateusz_czytania.recipe @@ -23,7 +23,6 @@ class czytania_mateusz(BasicNewsRecipe): remove_javascript = True simultaneous_downloads = 2 max_articles_per_feed = 100 - auto_cleanup = True feeds = [(u'Czytania', u'http://mateusz.pl/rss/czytania/')] diff --git a/recipes/modoros.recipe b/recipes/modoros.recipe index a65499f08c..c9d1269630 100644 --- a/recipes/modoros.recipe +++ b/recipes/modoros.recipe @@ -24,7 +24,6 @@ class ModorosBlogHu(BasicNewsRecipe): remove_empty_feeds = True no_stylesheets = True feeds = [(u'Modoros Blog', u'http://modoros.blog.hu/rss')] - remove_javascript = True use_embedded_content = False preprocess_regexps = [ (re.compile(r'.*?', re.DOTALL | re.IGNORECASE), diff --git a/recipes/myapple_pl.recipe b/recipes/myapple_pl.recipe index 8e28e8ff89..46bc27eab0 100644 --- a/recipes/myapple_pl.recipe +++ b/recipes/myapple_pl.recipe @@ -12,7 +12,6 @@ class MyAppleRecipe(BasicNewsRecipe): description = u' Największy w Polsce serwis zajmujący się tematyką związaną z Apple i wszelkimi produktami tej firmy.' cover_url = '' remove_empty_feeds = True - no_stylesheets = True oldest_article = 7 max_articles_per_feed = 100000 recursions = 0 diff --git a/recipes/natgeo.recipe b/recipes/natgeo.recipe index 047c23a544..f54294fac4 100644 --- a/recipes/natgeo.recipe +++ b/recipes/natgeo.recipe @@ -7,13 +7,13 @@ from calibre.web.feeds.news import BasicNewsRecipe, classes class NatGeo(BasicNewsRecipe): title = 'National Geographic' - description = 'News articles from The National Geographic, Download Monthly.' + description = ('News articles from The National Geographic, Download Monthly. ' + 'Inspiring people to care about the planet since 1888') language = 'en' encoding = 'utf8' publisher = 'nationalgeographic.com' category = 'science, nat geo' __author__ = 'Kovid Goyal, unkn0wn' - description = 'Inspiring people to care about the planet since 1888' timefmt = ' [%a, %d %b, %Y]' no_stylesheets = True use_embedded_content = False diff --git a/recipes/natgeo_kids.recipe b/recipes/natgeo_kids.recipe index 813c4bce87..834ba19305 100644 --- a/recipes/natgeo_kids.recipe +++ b/recipes/natgeo_kids.recipe @@ -6,13 +6,13 @@ from calibre.web.feeds.news import BasicNewsRecipe class NatGeo(BasicNewsRecipe): title = 'National Geographic Kids' - description = 'The National Geographic, an American monthly magazine' + description = ('The National Geographic, an American monthly magazine. ' + 'Inspiring people to care about the planet since 1888') language = 'en' encoding = 'utf8' publisher = 'kids.nationalgeographic.com' category = 'science, nat geo' __author__ = 'unkn0wn' - description = 'Inspiring people to care about the planet since 1888' timefmt = ' [%a, %d %b, %Y]' use_embedded_content = False remove_javascript = True diff --git a/recipes/natgeo_traveller.recipe b/recipes/natgeo_traveller.recipe index 8500b2d8ab..e7ccafccf7 100644 --- a/recipes/natgeo_traveller.recipe +++ b/recipes/natgeo_traveller.recipe @@ -7,13 +7,13 @@ from calibre.web.feeds.news import BasicNewsRecipe, classes class NatGeo(BasicNewsRecipe): title = 'National Geographic Traveller' - description = 'News articles from The National Geographic Traveller, Download Monthly.' + description = ('News articles from The National Geographic Traveller, Download Monthly. ' + 'Inspiring people to care about the planet since 1888') language = 'en' encoding = 'utf8' publisher = 'nationalgeographic.com' category = 'science, nat geo' __author__ = 'unkn0wn' - description = 'Inspiring people to care about the planet since 1888' timefmt = ' [%a, %d %b, %Y]' no_stylesheets = True use_embedded_content = False diff --git a/recipes/natgeohis.recipe b/recipes/natgeohis.recipe index bc56c2be3e..cdec6edd84 100644 --- a/recipes/natgeohis.recipe +++ b/recipes/natgeohis.recipe @@ -5,16 +5,14 @@ from calibre.web.feeds.news import BasicNewsRecipe, classes class NatGeo(BasicNewsRecipe): title = 'National Geographic History' - description = ( - 'From Caesar to Napoleon, the Pyramids to the Parthenon, the Trojan War to the Civil War—National Geographic ' - 'HISTORY draws readers in with more than 5,000 years of people, places, and things to explore.' - ) + description = ('From Caesar to Napoleon, the Pyramids to the Parthenon, the Trojan War to the Civil War—National Geographic ' + 'HISTORY draws readers in with more than 5,000 years of people, places, and things to explore. ' + 'Inspiring people to care about the planet since 1888') language = 'en' encoding = 'utf8' publisher = 'nationalgeographic.com' category = 'science, nat geo' __author__ = 'Kovid Goyal, unkn0wn' - description = 'Inspiring people to care about the planet since 1888' timefmt = ' [%a, %d %b, %Y]' no_stylesheets = True use_embedded_content = False diff --git a/recipes/natgeomag.recipe b/recipes/natgeomag.recipe index d2ec0f3f49..91d77089db 100644 --- a/recipes/natgeomag.recipe +++ b/recipes/natgeomag.recipe @@ -8,13 +8,13 @@ from calibre.web.feeds.news import BasicNewsRecipe, classes class NatGeo(BasicNewsRecipe): title = 'National Geographic Magazine' - description = 'The National Geographic, an American monthly magazine' + description = ('The National Geographic, an American monthly magazine. ' + 'Inspiring people to care about the planet since 1888') language = 'en' encoding = 'utf8' publisher = 'nationalgeographic.com' category = 'science, nat geo' __author__ = 'Kovid Goyal, unkn0wn' - description = 'Inspiring people to care about the planet since 1888' timefmt = ' [%a, %d %b, %Y]' no_stylesheets = True use_embedded_content = False diff --git a/recipes/nme.recipe b/recipes/nme.recipe index 80e8481251..ada5fb066e 100644 --- a/recipes/nme.recipe +++ b/recipes/nme.recipe @@ -27,7 +27,6 @@ class AdvancedUserRecipe1306061239(BasicNewsRecipe): simultaneous_downloads = 20 use_embedded_content = False recursions = 0 - auto_cleanup = True feeds = [ (u'NME News', u'http://www.nme.com/news/feed'), diff --git a/recipes/novinite_bg.recipe b/recipes/novinite_bg.recipe index 0bf794da60..b3db41c18e 100644 --- a/recipes/novinite_bg.recipe +++ b/recipes/novinite_bg.recipe @@ -13,8 +13,10 @@ class AdvancedUserRecipe1329123365(BasicNewsRecipe): no_stylesheets = True remove_javascript = True keep_only_tags = [dict(name='div', attrs={'id': 'content'})] - remove_tags = [dict(name='div', attrs={'id': 'text_options'})] - remove_tags = [dict(name='div', attrs={'id': 'social_shares_top'})] + remove_tags = [ + dict(name='div', attrs={'id': 'text_options'}), + dict(name='div', attrs={'id': 'social_shares_top'}), + ] remove_tags_after = dict(id='textsize') feeds = [(u'Business', u'http://novinite.bg/rss.php?category_id=1'), (u'Politics', u'http://novinite.bg/rss.php?category_id=2'), diff --git a/recipes/nytimes_sports.recipe b/recipes/nytimes_sports.recipe index 2e752483c6..f07b5f285e 100644 --- a/recipes/nytimes_sports.recipe +++ b/recipes/nytimes_sports.recipe @@ -32,7 +32,6 @@ class NYTimesSports(BasicNewsRecipe): max_articles_per_feed = 25 use_embedded_content = False no_stylesheets = True - language = 'en' delay = 1 feeds = [ diff --git a/recipes/optyczne_pl.recipe b/recipes/optyczne_pl.recipe index c0648ffc13..4dd2834e97 100644 --- a/recipes/optyczne_pl.recipe +++ b/recipes/optyczne_pl.recipe @@ -13,7 +13,6 @@ class OptyczneRecipe(BasicNewsRecipe): description = u'Najlepsze testy obiektywów, testy aparatów cyfrowych i testy lornetek w sieci!' cover_url = '' remove_empty_feeds = True - no_stylesheets = True oldest_article = 7 max_articles_per_feed = 100 recursions = 0 diff --git a/recipes/orfonline.recipe b/recipes/orfonline.recipe index 85035f4195..0d162ca4b8 100644 --- a/recipes/orfonline.recipe +++ b/recipes/orfonline.recipe @@ -20,7 +20,6 @@ class ORF(BasicNewsRecipe): masthead_url = 'https://www.orfonline.org/wp-content/uploads/2015/09/Logo_ORF_JPEG.jpg' remove_attributes = ['style', 'height', 'width'] ignore_duplicate_articles = {'url', 'title'} - remove_empty_feeds = True oldest_article = 7 simultaneous_downloads = 1 diff --git a/recipes/people_daily.recipe b/recipes/people_daily.recipe index e20d070a83..f6521fdbff 100644 --- a/recipes/people_daily.recipe +++ b/recipes/people_daily.recipe @@ -20,7 +20,6 @@ class AdvancedUserRecipe1277129332(BasicNewsRecipe): use_embedded_content = False no_stylesheets = True encoding = 'GB2312' - language = 'zh' conversion_options = {'linearize_tables': True} masthead_url = 'http://www.people.com.cn/img/2010wb/images/logo.gif' diff --git a/recipes/ppe_pl.recipe b/recipes/ppe_pl.recipe index 354b5eec5d..e5e7279ab4 100644 --- a/recipes/ppe_pl.recipe +++ b/recipes/ppe_pl.recipe @@ -11,7 +11,6 @@ class ppeRecipe(BasicNewsRecipe): category = u'News' description = u'Portal o konsolach i grach wideo.' extra_css = '.categories > li {list-style: none; display: inline;} .galmini > li {list-style: none; float: left;} .calibre_navbar {clear: both;}' - remove_empty_feeds = True no_stylesheets = True oldest_article = 7 max_articles_per_feed = 100 diff --git a/recipes/readers_digest.recipe b/recipes/readers_digest.recipe index 79cd854ea8..9c373528c6 100644 --- a/recipes/readers_digest.recipe +++ b/recipes/readers_digest.recipe @@ -23,7 +23,6 @@ class ReadersDigest(BasicNewsRecipe): oldest_article = 60 max_articles_per_feed = 200 - language = 'en' remove_javascript = True remove_attributes = ['style'] diff --git a/recipes/skai.recipe b/recipes/skai.recipe index dbf80c27e3..3c77de16a7 100644 --- a/recipes/skai.recipe +++ b/recipes/skai.recipe @@ -14,7 +14,6 @@ class SKAI(BasicNewsRecipe): no_stylesheets = True use_embedded_content = False remove_empty_feeds = True - encoding = 'utf8' keep_only_tags = [ dict(name='h1'), dict(name='div', attrs={'class': ['articleText']}) diff --git a/recipes/theoldie.recipe b/recipes/theoldie.recipe index 2f7c8e2431..ef5bf5a776 100644 --- a/recipes/theoldie.recipe +++ b/recipes/theoldie.recipe @@ -43,7 +43,7 @@ class PrivateEyeRecipe(BasicNewsRecipe): name = 'Oldie Online' series = 'The ' + name now = datetime.now().strftime(' %Y-%m') - title = series + now + title = series + now # noqa: PIE794 title_sort = name + now + ', The' conversion_options = { 'authors': 'The Oldie', diff --git a/recipes/usatoday.recipe b/recipes/usatoday.recipe index 59d9d7ffb5..46fe9061c8 100644 --- a/recipes/usatoday.recipe +++ b/recipes/usatoday.recipe @@ -32,7 +32,6 @@ class USAToday(BasicNewsRecipe): timefmt = ' [%d %b %Y]' max_articles_per_feed = 25 no_stylesheets = True - remove_empty_feeds = True keep_only_tags = [ classes('gnt_ar_hl gnt_ar_by gnt_ar_b topper__inner in-depth-content'), diff --git a/recipes/walla.recipe b/recipes/walla.recipe index 8f2ff4f2bd..226c22b4ee 100644 --- a/recipes/walla.recipe +++ b/recipes/walla.recipe @@ -19,7 +19,6 @@ class AdvancedUserRecipe1283848012(BasicNewsRecipe): dict(name='p', attrs={'class': 'subtitle'}), dict(name='p', attrs={'class': 'article_speakable'}), ] - max_articles_per_feed = 100 feeds = [ (u'חדשות', u'https://rss.walla.co.il/feed/1?type=main'), diff --git a/recipes/woz_die.recipe b/recipes/woz_die.recipe index 55f39fdd1a..e48c2d630a 100644 --- a/recipes/woz_die.recipe +++ b/recipes/woz_die.recipe @@ -8,9 +8,11 @@ class WozDie(BasicNewsRecipe): language = 'de' no_stylesheets = True - remove_tags = [dict(name='p', attrs={'class': 'arrow_top'})] - remove_tags = [dict(name='p', attrs={'class': 'bottom_right'})] - remove_tags = [dict(name='script')] + remove_tags = [ + dict(name='p', attrs={'class': 'arrow_top'}), + dict(name='p', attrs={'class': 'bottom_right'}), + dict(name='script'), + ] extra_css = '''#print_titel{vertical-align: bottom; text-align: left; color: #666666; background-color: white; padding-top: 30px; padding- bottom: 10px; border-bottom: 1px solid #999999;} #title{text-align: diff --git a/ruff-strict-pep8.toml b/ruff-strict-pep8.toml index 5d0aeb3fb2..cea7e295ea 100644 --- a/ruff-strict-pep8.toml +++ b/ruff-strict-pep8.toml @@ -22,7 +22,7 @@ quote-style = 'single' explicit-preview-rules = true ignore = [ 'E402', 'E722', 'E741', - 'UP012', 'UP030', 'UP032', 'UP038', 'C413', 'C420', 'PIE790', 'PIE794', + 'UP012', 'UP030', 'UP032', 'UP038', 'C413', 'C420', 'PIE790', 'RUF001', 'RUF002', 'RUF003', 'RUF005', 'RUF012', 'RUF013', 'RUF015', 'RUF031', 'RUF100', 'F841', # because in preview, unused tuple unpacking variable that not use dummy syntax (prefix '_' underscore) # raise error 'unused-variable', sigh (https://github.com/astral-sh/ruff/issues/8884) @@ -40,6 +40,7 @@ select = [ 'E111', 'E112', 'E113', 'E117', # code indentation 'E114', 'E115', 'E116', 'E261', 'E262', 'E265', # comment formating ] +unfixable = ['PIE794'] [lint.per-file-ignores] "recipes/*" = ['UP'] diff --git a/src/calibre/devices/mtp/driver.py b/src/calibre/devices/mtp/driver.py index d87239e6ee..21852bd911 100644 --- a/src/calibre/devices/mtp/driver.py +++ b/src/calibre/devices/mtp/driver.py @@ -50,7 +50,6 @@ class MTP_DEVICE(BASE): METADATA_CACHE = 'metadata.calibre' DRIVEINFO = 'driveinfo.calibre' - CAN_SET_METADATA = [] NEWS_IN_FOLDER = True MAX_PATH_LEN = 230 THUMBNAIL_HEIGHT = DEFAULT_THUMBNAIL_HEIGHT diff --git a/src/calibre/gui2/viewer/web_view.py b/src/calibre/gui2/viewer/web_view.py index 753d687898..b969546eed 100644 --- a/src/calibre/gui2/viewer/web_view.py +++ b/src/calibre/gui2/viewer/web_view.py @@ -263,7 +263,6 @@ class ViewerBridge(Bridge): search_result_not_found = from_js(object) search_result_discovered = from_js(object) find_next = from_js(object) - quit = from_js() update_current_toc_nodes = from_js(object) toggle_full_screen = from_js() report_cfi = from_js(object, object) @@ -477,7 +476,6 @@ class WebView(RestartingWebEngineView): new_bookmark = pyqtSignal(object) toggle_inspector = pyqtSignal() toggle_lookup = pyqtSignal(object) - quit = pyqtSignal() update_current_toc_nodes = pyqtSignal(object) toggle_full_screen = pyqtSignal() ask_for_open = pyqtSignal(object)