jenkins-bot has submitted this change and it was merged.
Change subject: [IMPR] use the more flexible pywikibot.Timestamp for
TimeStripper.timestripper
......................................................................
[IMPR] use the more flexible pywikibot.Timestamp for TimeStripper.timestripper
Change-Id: I76ffffdfa4bdcd5a9c9e7447cab3c0a5d2b46289
---
M pywikibot/textlib.py
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index f5c2888..05e0b8b 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -1684,7 +1684,7 @@
class TimeStripper(object):
- """Find timestamp in page and return it as timezone aware datetime
object."""
+ """Find timestamp in page and return it as pywikibot.Timestamp
object."""
def __init__(self, site=None):
"""Constructor."""
@@ -1795,6 +1795,8 @@
All the following items must be matched, otherwise None is returned:
-. year, month, hour, time, day, minute, tzinfo
+ @return: A timestamp found on the given line
+ @rtype: pywikibot.Timestamp
"""
# match date fields
dateDict = dict()
@@ -1846,7 +1848,7 @@
# find timezone
dateDict['tzinfo'] = self.tzinfo
- timestamp = datetime.datetime(**dateDict)
+ timestamp = pywikibot.Timestamp(**dateDict)
else:
timestamp = None
--
To view, visit
https://gerrit.wikimedia.org/r/253869
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I76ffffdfa4bdcd5a9c9e7447cab3c0a5d2b46289
Gerrit-PatchSet: 7
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>