From 4c7255854d62098843658684370466562c21fe5a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 22 Jul 2024 11:17:58 +0530 Subject: [PATCH] pep8 --- recipes/livemint.recipe | 11 ++++------- recipes/natgeomag.recipe | 1 - 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/recipes/livemint.recipe b/recipes/livemint.recipe index b977b10e47..3ea015d557 100644 --- a/recipes/livemint.recipe +++ b/recipes/livemint.recipe @@ -19,25 +19,22 @@ class LiveMint(BasicNewsRecipe): remove_attributes = ['style', 'height', 'width'] masthead_url = 'https://images.livemint.com/static/livemint-logo-v1.svg' - recipe_specific_options = { + 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) } } + remove_empty_feeds = True + resolve_internal_links = True + def __init__(self, *args, **kwargs): BasicNewsRecipe.__init__(self, *args, **kwargs) d = self.recipe_specific_options.get('days') if d and isinstance(d, str): self.oldest_article = float(d) - - remove_empty_feeds = True - resolve_internal_links = True - - def __init__(self, *args, **kwargs): - BasicNewsRecipe.__init__(self, *args, **kwargs) if self.output_profile.short_name.startswith('kindle'): self.title = 'Mint | ' + date.today().strftime('%b %d, %Y') if is_saturday: diff --git a/recipes/natgeomag.recipe b/recipes/natgeomag.recipe index c95b239d8f..70724ab4e5 100644 --- a/recipes/natgeomag.recipe +++ b/recipes/natgeomag.recipe @@ -192,7 +192,6 @@ class NatGeo(BasicNewsRecipe): # self.cover_url = png[0] + '?w=1000&h=1000' self.cover_url = soup.find('meta', attrs={'property':'og:image'})['content'].split('?')[0] + '?w=1000' - name = soup.find(attrs={'class':lambda x: x and 'Header__Description' in x.split()}) # self.title = 'National Geographic ' + self.tag_to_string(name) ans = {} if photoart := soup.find(attrs={'class':lambda x: x and 'BgImagePromo__Container__Text__Link' in x.split()}):