jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/593495 )
Change subject: [cleanup] Replace deprecated getcurrenttime by server_time method ......................................................................
[cleanup] Replace deprecated getcurrenttime by server_time method
Change-Id: I36537b7da01eeb2da421c09063a23897495da3e0 --- M pywikibot/__init__.py M scripts/newitem.py 2 files changed, 4 insertions(+), 5 deletions(-)
Approvals: D3r1ck01: Looks good to me, but someone else must approve Framawiki: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py index 7866b27..6a0b4e1 100644 --- a/pywikibot/__init__.py +++ b/pywikibot/__init__.py @@ -153,9 +153,8 @@ when previously they returned a MediaWiki string representation, these methods also accept a Timestamp object, in which case they return a clone.
- Use Site.getcurrenttime() for the current time; this is more reliable + Use Site.server_time() for the current time; this is more reliable than using Timestamp.utcnow(). - """
mediawikiTSFormat = '%Y%m%d%H%M%S' diff --git a/scripts/newitem.py b/scripts/newitem.py index 0ff8810..79eeb0e 100755 --- a/scripts/newitem.py +++ b/scripts/newitem.py @@ -21,7 +21,7 @@
""" # -# (C) Pywikibot team, 2014-2019 +# (C) Pywikibot team, 2014-2020 # # Distributed under the terms of the MIT license. # @@ -56,9 +56,9 @@ self.generator = generator self.pageAge = self.getOption('pageage') self.lastEdit = self.getOption('lastedit') - self.pageAgeBefore = self.repo.getcurrenttime() - timedelta( + self.pageAgeBefore = self.repo.server_time() - timedelta( days=self.pageAge) - self.lastEditBefore = self.repo.getcurrenttime() - timedelta( + self.lastEditBefore = self.repo.server_time() - timedelta( days=self.lastEdit) pywikibot.output('Page age is set to {0} days so only pages created' '\nbefore {1} will be considered.'
pywikibot-commits@lists.wikimedia.org