Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/825341 )
Change subject: [doc] update archivebot.py documentation
......................................................................
[doc] update archivebot.py documentation
Change-Id: I7d57f9889be5f84d51b2f97218f2e299d8279318
---
M scripts/archivebot.py
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index 16993f8..3f0e4c0 100755
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -362,6 +362,8 @@
.. versionchanged:: 7.6
If `-keep` option is given run through all threads and set
the current timestamp to the previous if the current is lower.
+ .. versionchanged:: 7.7
+ Load unsigned threads using timestamp of the next thread.
"""
self.header = ''
self.threads = []
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/825341
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I7d57f9889be5f84d51b2f97218f2e299d8279318
Gerrit-Change-Number: 825341
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/820477 )
Change subject: [IMPR] Archive unsigned threads using timestamp of the next thread
......................................................................
[IMPR] Archive unsigned threads using timestamp of the next thread
Also update tests
Bug: T182685
Bug: T69663
Change-Id: Ib23632ad396ab918f4eff695b93ab80c037b06f9
---
M scripts/archivebot.py
M tests/archivebot_tests.py
2 files changed, 6 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index a756bbd..d431371 100755
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -389,6 +389,11 @@
cur_thread.feed_line(line)
self.threads.append(cur_thread)
+ # add latter timestamp to predecessor if it is None
+ for last, prev in pairwise(reversed(self.threads)):
+ if not prev.timestamp:
+ prev.timestamp = last.timestamp
+
if self.keep:
# set the timestamp to the previous if the current is lower
for first, second in pairwise(self.threads):
diff --git a/tests/archivebot_tests.py b/tests/archivebot_tests.py
index fd7831d..0a7bbf5 100755
--- a/tests/archivebot_tests.py
+++ b/tests/archivebot_tests.py
@@ -112,6 +112,7 @@
sites = {code: {'family': 'wikipedia', 'code': code} for code in THREADS}
cached = True
+ expected_failures = ['ar', 'scn', 'th']
def test_archivebot(self, code=None):
"""Test archivebot for one site."""
@@ -142,7 +143,6 @@
self.assertIsInstance(thread.content, str)
self.assertIsInstance(thread.timestamp, datetime)
- expected_failures = ['ar', 'eo', 'pdc', 'scn', 'th']
# FIXME: see TestArchiveBotAfterDateUpdate()
# 'ar': Uses Arabic acronym for TZ
# 'eo': changed month name setting in wiki from Sep to sep
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/820477
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ib23632ad396ab918f4eff695b93ab80c037b06f9
Gerrit-Change-Number: 820477
Gerrit-PatchSet: 5
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged