jenkins-bot merged this change.

View Change

Approvals: D3r1ck01: Looks good to me, but someone else must approve Framawiki: Looks good to me, approved jenkins-bot: Verified
[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(-)

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.'

To view, visit change 593495. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I36537b7da01eeb2da421c09063a23897495da3e0
Gerrit-Change-Number: 593495
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: Framawiki <framawiki@tools.wmflabs.org>
Gerrit-Reviewer: jenkins-bot (75)