Rename publication_date to edition_date ...

... because as of commit 7567ced5288ab0e9a420c9622c54a1476bc884cc on 21 December 2020, publication_date is now a method of the super object BasicNewsRecipe.
This commit is contained in:
Sophist 2021-05-01 23:16:08 +01:00 committed by GitHub
parent e5b034b8c5
commit d43e30e796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,11 +80,11 @@ class PrivateEyeRecipe(BasicNewsRecipe):
return url return url
urls = [] urls = []
publication_date = "" edition_date = ""
def add_article(self, title, url, description="", date=None): def add_article(self, title, url, description="", date=None):
if date is None: if date is None:
date = self.publication_date date = self.edition_date
if url and url not in self.urls: if url and url not in self.urls:
self.urls.append(url) self.urls.append(url)
self.log.info( self.log.info(
@ -139,9 +139,9 @@ class PrivateEyeRecipe(BasicNewsRecipe):
date = datetime.strptime( date = datetime.strptime(
" ".join((day, month, year)), "%d %B %Y") " ".join((day, month, year)), "%d %B %Y")
date = date - timedelta(11) date = date - timedelta(11)
self.publication_date = datetime.strftime( self.edition_date = datetime.strftime(
date, "%d %B %Y").lstrip("0") date, "%d %B %Y").lstrip("0")
self.log.debug("Publication date: %s" % self.publication_date) self.log.debug("Publication date: %s" % self.edition_date)
self.title_with_date = self.title + datetime.strftime( self.title_with_date = self.title + datetime.strftime(
date, " %Y-%m-%d") date, " %Y-%m-%d")
break break