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
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/824856 )
Change subject: [doc] Update some version hints
......................................................................
[doc] Update some version hints
Change-Id: Idcebe4eba4ffcae5fe797ec57fae9cfaf1f60e61
---
M ROADMAP.rst
M pywikibot/site/_generators.py
M pywikibot/textlib.py
3 files changed, 11 insertions(+), 4 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 4a13866..2a9c1b8 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -7,6 +7,7 @@
Deprecations
^^^^^^^^^^^^
+* 7.6.0: :mod:`tools.itertools` datatypes should no longer imported from :mod:`pywikibot.tools`
* 7.6.0: :mod:`tools.collections` datatypes should no longer imported from :mod:`pywikibot.tools`
* 7.5.0: :mod:`pywikibot.textlib`.tzoneFixedOffset class will be removed in favour of :class:`pywikibot.time.TZoneFixedOffset`
* 7.4.0: `FilePage.usingPages()` was renamed to :meth:`using_pages()<pywikibot.FilePage.using_pages>`
diff --git a/pywikibot/site/_generators.py b/pywikibot/site/_generators.py
index aad1b86..021ac70 100644
--- a/pywikibot/site/_generators.py
+++ b/pywikibot/site/_generators.py
@@ -101,6 +101,9 @@
Pages are iterated in the same order than in the underlying pagelist.
In case of duplicates in a groupsize batch, return the first entry.
+ .. versionchanged:: 7.6
+ ``content`` parameter was added.
+
:param pagelist: an iterable that returns Page objects
:param groupsize: how many Pages to query at a time
:param templates: preload pages (typically templates) transcluded in
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index d6eab05..f8e1675 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -1966,14 +1966,17 @@
return False
return True
- def timestripper(self, line):
+ def timestripper(self, line: str) -> Optional['pywikibot.Timestamp']:
"""
Find timestamp in line and convert it to time zone aware datetime.
- All the following items must be matched, otherwise None is returned:
- -. year, month, hour, time, day, minute, tzinfo
+ All the following items must be matched, otherwise None is
+ returned: -. year, month, hour, time, day, minute, tzinfo
+
+ .. versionchanged:: 7.6
+ HTML parts are removed from line
+
:return: A timestamp found on the given line
- :rtype: pywikibot.Timestamp
"""
# Try to maintain gaps that are used in _valid_date_dict_positions()
def censor_match(match):
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/824856
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: Idcebe4eba4ffcae5fe797ec57fae9cfaf1f60e61
Gerrit-Change-Number: 824856
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/824855 )
Change subject: [7.7] Prepare next release Pywikibot 7.7
......................................................................
[7.7] Prepare next release Pywikibot 7.7
Change-Id: I8ba3aebc0544148a3b83e915b5efbbafc3f903b8
---
M .appveyor.yml
M HISTORY.rst
M ROADMAP.rst
M pywikibot/__metadata__.py
M scripts/__init__.py
5 files changed, 33 insertions(+), 26 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.appveyor.yml b/.appveyor.yml
index c11301c..75a438e 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -1,7 +1,7 @@
image: Visual Studio 2019
clone_depth: 50
skip_tags: true
-version: 7.6.{build}
+version: 7.7.{build}
environment:
PYWIKIBOT_DIR: "%appdata%\\Pywikibot"
diff --git a/HISTORY.rst b/HISTORY.rst
index 3f64ec3..1025ec1 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -1,6 +1,33 @@
Release history
^^^^^^^^^^^^^^^
+7.6.0
+-----
+*21 August 2022*
+
+* Add support for pcmwiki, guvwikt and bjnwikt (:phab:`T309059`, :phab:`T310882`, :phab:`T312217`)
+* support *not* loading text :meth:`site.APISite.preloadpages` (:phab:`T67163`)
+* :func:`textlib.TimeStripper.timestripper` removes HTML elements before searching for
+ timestamp in text (:phab:`T302496`)
+* backport :mod:`backports.pairwise()<backports>` from Python 3.10
+* L10N updates
+* Fix partial caching in :meth:`Category.subcategories()<page.Category.subcategories>` (:phab:`T88217`)
+* Method :meth:`Page.has_content()<page.BasePage.has_content>` was added (:phab:`T313736`)
+* Discard cache and reload it if cache was loaded without content and content is required
+ in :meth:`Page.templates()<page.BasePage.templates>` (:phab:`T313736`)
+* Add support for vikidia:oc
+* Exit loop in PageFromFileReader if match.end() <= 0 (:phab:`T313684`)
+* Allow Exception as parameter of pywikibot.exceptions.Error
+* Make :func:`GoogleSearchPageGenerator<pagegenerators.GoogleSearchPageGenerator>`
+ and :func:`PetScanPageGenerator<pagegenerators.PetScanPageGenerator>` a restartable
+ Generator (:phab:`T313681`, :phab:`T313683`)
+* Provide a :class:`collections.GeneratorWrapper<tools.collections.GeneratorWrapper>`
+ class to start/restart a generator (:phab:`T301318`, :phab:`T312654`, :phab:`T312883`)
+* tools' itertools functions were moved to :mod:`tools.itertools` submodule
+* tools' collections classes were moved to :mod:`tools.collections` submodule
+* Set successful login status for the OAuth case (:phab:`T313571`)
+
+
7.5.0
-----
*22 July 2022*
@@ -88,7 +115,7 @@
* `use_disambig` BaseBot attribute was added to hande disambig skipping
* Deprecate RedirectPageBot and NoRedirectPageBot in favour of `use_redirects` attribute
* tools.formatter.color_format is deprecated and will be removed
-* A new and easier color format was implemented; colors can be used like:
+* A new and easier color format was implemented; colors can be used like:
``'this is a <<green>>colored<<default>> text'``
* Unused and unsupported `xmlreader.XmlParserThread` was removed
* Use upercased IP user titles (:phab:`T306291`)
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 0add0c8..4a13866 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,27 +1,7 @@
-Current release 7.6.0
+Current release 7.7.0
^^^^^^^^^^^^^^^^^^^^^
-* Add support for pcmwiki, guvwikt and bjnwikt (:phab:`T309059`, :phab:`T310882`, :phab:`T312217`)
-* support *not* loading text :meth:`site.APISite.preloadpages` (:phab:`T67163`)
-* :func:`textlib.TimeStripper.timestripper` removes HTML elements before searching for
- timestamp in text (:phab:`T302496`)
-* backport :mod:`backports.pairwise()<backports>` from Python 3.10
-* L10N updates
-* Fix partial caching in :meth:`Category.subcategories()<page.Category.subcategories>` (:phab:`T88217`)
-* Method :meth:`Page.has_content()<page.BasePage.has_content>` was added (:phab:`T313736`)
-* Discard cache and reload it if cache was loaded without content and content is required
- in :meth:`Page.templates()<page.BasePage.templates>` (:phab:`T313736`)
-* Add support for vikidia:oc
-* Exit loop in PageFromFileReader if match.end() <= 0 (:phab:`T313684`)
-* Allow Exception as parameter of pywikibot.exceptions.Error
-* Make :func:`GoogleSearchPageGenerator<pagegenerators.GoogleSearchPageGenerator>`
- and :func:`PetScanPageGenerator<pagegenerators.PetScanPageGenerator>` a restartable
- Generator (:phab:`T313681`, :phab:`T313683`)
-* Provide a :class:`collections.GeneratorWrapper<tools.collections.GeneratorWrapper>`
- class to start/restart a generator (:phab:`T301318`, :phab:`T312654`, :phab:`T312883`)
-* tools' itertools functions were moved to :mod:`tools.itertools` submodule
-* tools' collections classes were moved to :mod:`tools.collections` submodule
-* Set successful login status for the OAuth case (:phab:`T313571`)
+*(no changes yet)*
Deprecations
diff --git a/pywikibot/__metadata__.py b/pywikibot/__metadata__.py
index d2dd282..9d6e66c 100644
--- a/pywikibot/__metadata__.py
+++ b/pywikibot/__metadata__.py
@@ -11,7 +11,7 @@
__name__ = 'pywikibot'
-__version__ = '7.6.0'
+__version__ = '7.7.0.dev0'
__description__ = 'Python MediaWiki Bot Framework'
__maintainer__ = 'The Pywikibot team'
__maintainer_email__ = 'pywikibot(a)lists.wikimedia.org'
diff --git a/scripts/__init__.py b/scripts/__init__.py
index 4ee5ede..c482795 100644
--- a/scripts/__init__.py
+++ b/scripts/__init__.py
@@ -29,4 +29,4 @@
#
# Distributed under the terms of the MIT license.
#
-__version__ = '7.6.0'
+__version__ = '7.7.0'
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/824855
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: I8ba3aebc0544148a3b83e915b5efbbafc3f903b8
Gerrit-Change-Number: 824855
Gerrit-PatchSet: 2
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