flake8 fixes

This commit is contained in:
Kovid Goyal 2025-04-03 21:47:31 +05:30
parent c1268ada46
commit 9117dcc471
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 6 deletions

View File

@ -100,8 +100,8 @@ class PrivateEyeRecipe(BasicNewsRecipe):
# Get publication date - Next issue on sale date - 12 days # Get publication date - Next issue on sale date - 12 days
issue_box = soup.find('div', attrs={'id': 'issue-box'}) issue_box = soup.find('div', attrs={'id': 'issue-box'})
next_issue_text = issue_box.find(text=re.compile('NEXT\s+ISSUE')).parent.contents[-1].strip() next_issue_text = issue_box.find(text=re.compile(r'NEXT\s+ISSUE')).parent.contents[-1].strip()
self.log("next_issue_text:", next_issue_text) self.log('next_issue_text:', next_issue_text)
try: try:
day, month, year = next_issue_text.split(' ') day, month, year = next_issue_text.split(' ')
# remove day suffixes e.g. 2nd # remove day suffixes e.g. 2nd
@ -124,7 +124,6 @@ class PrivateEyeRecipe(BasicNewsRecipe):
section = soup.find('div', attrs=section_attrs) section = soup.find('div', attrs=section_attrs)
if not section: if not section:
self.log("section not found:", section_id)
continue continue
for a in section.findAll('a', href=True): for a in section.findAll('a', href=True):
@ -141,7 +140,7 @@ class PrivateEyeRecipe(BasicNewsRecipe):
url = self.base_url + url url = self.base_url + url
if url in urls: if url in urls:
continue continue
self.log("title:", title, ", url:", url) self.log('title:', title, ', url:', url)
urls.append(url) urls.append(url)
articles.append({ articles.append({
'title': title, 'title': title,

View File

@ -53,8 +53,8 @@ class Reuters(BasicNewsRecipe):
'default': '480', 'default': '480',
}, },
'spr': { 'spr': {
'short': 'Include Sports sections?' 'short': 'Include Sports sections?',
'long':'Yes/No' 'long':'Yes/No',
'default': 'No' 'default': 'No'
} }
} }