Gerrit Patch Uploader has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/205023

Change subject: Use the cached editTime if available
......................................................................

Use the cached editTime if available

Change-Id: Ifa4f0b2f724731805b2f028b84079c055415d9df
---
M pywikibot/page.py
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/23/205023/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index a2eb04c..b3a2abc 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -567,12 +567,14 @@
         return self._lastNonBotUser
 
     @remove_last_args(('datetime', ))
-    def editTime(self):
+    def editTime(self, force=False):
         """Return timestamp of last revision to page.
 
         @rtype: pywikibot.Timestamp
         """
-        return self.latest_revision.timestamp
+       if not force and hasattr(self, '_timestamp'):
+            return pywikibot.Timestamp.fromISOformat(self._timestamp)
+       return self.latest_revision.timestamp
 
     @property
     def previous_revision_id(self):

-- 
To view, visit https://gerrit.wikimedia.org/r/205023
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa4f0b2f724731805b2f028b84079c055415d9df
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <[email protected]>
Gerrit-Reviewer: Strainu <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to