jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/656394 )
Change subject: [doc] update ROADMAP.rst
......................................................................
[doc] update ROADMAP.rst
Also increase version number to 5.6
Change-Id: I46cd41f027b6ed1fefe20e6a1282fef74a774cec
---
M .appveyor.yml
M ROADMAP.rst
M pywikibot/__metadata__.py
3 files changed, 9 insertions(+), 4 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.appveyor.yml b/.appveyor.yml
index 021ca49..bf53c50 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -1,6 +1,6 @@
clone_depth: 50
skip_tags: true
-version: 5.5.{build}
+version: 5.6.{build}
environment:
APPVEYOR_PYTHON_URL: "https://raw.githubusercontent.com/dvorapa/python-appveyor-demo/master/appve…"
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 279248e..a622d27 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,11 +1,17 @@
Current release changes
~~~~~~~~~~~~~~~~~~~~~~~
-* (no changes yet)
+* data attribute of http.fetch() response is deprecated (T265206)
+* Positional arguments of page.Revision aren't supported any longer (T259428)
+* pagenenerators.handleArg() method was renamed to handle_arg() (T271437)
+* Page methods deprecated for 6 years were removed
+* Create a Site with AutoFamily if a family isn't predefined (T249087)
Future release notes
~~~~~~~~~~~~~~~~~~~~
+* 5.6.0: APISite.loadimageinfo will no longer return any content
+* 5.6.0: pagenenerators.handleArg() method will be removed in favour of handle_arg() (T271437)
* 5.5.0: Site.getuserinfo() method will be dropped in favour of userinfo property
* 5.5.0: Site.getglobaluserinfo() method will be dropped in favour of globaluserinfo property
* 5.4.0: Support of MediaWiki < 1.23 will be dropped with release 6.0 (T268979)
@@ -14,7 +20,6 @@
* 5.3.0: api.ParamInfo.modules property will be removed
* 5.3.0: LogEntryFactory.logtypes property will be removed
* 5.3.0: stdout parameter of logging.output()/pywikibot.output() function will be desupported
-* 5.1.0: Positional arguments of page.Revision must be replaced by keyword arguments (T259428)
* 5.0.0: HttpRequest result of http.fetch() will be replaced by requests.Response (T265206)
* 5.0.0: OptionHandler.options dict will be removed in favour of OptionHandler.opt
* 5.0.0: Methods deprecated for 5 years or longer will be removed
diff --git a/pywikibot/__metadata__.py b/pywikibot/__metadata__.py
index 3471f87..ab161bb 100644
--- a/pywikibot/__metadata__.py
+++ b/pywikibot/__metadata__.py
@@ -5,7 +5,7 @@
# Distributed under the terms of the MIT license.
#
__name__ = 'pywikibot'
-__version__ = '5.5.1.dev0'
+__version__ = '5.6.0.dev0'
__description__ = 'Python MediaWiki Bot Framework'
__maintainer__ = 'The Pywikibot team'
__maintainer_email__ = 'pywikibot(a)lists.wikimedia.org'
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/656394
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: I46cd41f027b6ed1fefe20e6a1282fef74a774cec
Gerrit-Change-Number: 656394
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/+/656178 )
Change subject: Bump year of two files updated in 2021
......................................................................
Bump year of two files updated in 2021
Bumping the dates was missed in 13713379026b1238d1f7b93166fcf20482e92b4b,
year in third file was bumped as part of 5cbffbe1dfe57f240a48675f823cb153dff10a59.
Change-Id: Icf4d12d346a8571d79b329d29ff04da94de4c7af
---
M pywikibot/page/__init__.py
M tests/wikistats_tests.py
2 files changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index b4d259f..aa2fd6e 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -11,7 +11,7 @@
"""
#
-# (C) Pywikibot team, 2008-2020
+# (C) Pywikibot team, 2008-2021
#
# Distributed under the terms of the MIT license.
#
diff --git a/tests/wikistats_tests.py b/tests/wikistats_tests.py
index a734807..5d4b206 100644
--- a/tests/wikistats_tests.py
+++ b/tests/wikistats_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Test cases for the WikiStats dataset."""
#
-# (C) Pywikibot team, 2014-2020
+# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/656178
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: Icf4d12d346a8571d79b329d29ff04da94de4c7af
Gerrit-Change-Number: 656178
Gerrit-PatchSet: 1
Gerrit-Owner: Lokal Profil <andre.costa(a)wikimedia.se>
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/+/653977 )
Change subject: [IMPR] remove some IDE warnings for site.py
......................................................................
[IMPR] remove some IDE warnings for site.py
Major change is to convert Site.redirectRegex() to
the property Site.redirect_regex, to avoid different signature
than base method's one.
Method has been deprecated with FutureWarning.
Change-Id: Icf7ea15683fa8f566acb7b28a7c37b3790bed1a2
---
M pywikibot/cosmetic_changes.py
M pywikibot/page/__init__.py
M pywikibot/site/__init__.py
M scripts/redirect.py
M tests/basesite_tests.py
5 files changed, 27 insertions(+), 18 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 6df193a..f6273ea 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -788,7 +788,7 @@
if not self.template:
exceptions = ['comment', 'math', 'nowiki', 'pre',
'syntaxhighlight', 'template', 'timeline',
- self.site.redirectRegex()]
+ self.site.redirect_regex]
text = textlib.replaceExcept(
text,
r'(?m)'
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index b4d259f..b2c38cd 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -2255,7 +2255,7 @@
raise pywikibot.NoPage(self)
if self.exists() and not self.isRedirectPage() and not force:
raise pywikibot.IsNotRedirectPage(self)
- redirect_regex = self.site.redirectRegex()
+ redirect_regex = self.site.redirect_regex
if self.exists():
old_text = self.get(get_redirect=True)
else:
diff --git a/pywikibot/site/__init__.py b/pywikibot/site/__init__.py
index e29b610..fe62cba 100644
--- a/pywikibot/site/__init__.py
+++ b/pywikibot/site/__init__.py
@@ -202,7 +202,8 @@
gen.set_maximum_items(total)
return gen
- def _request_class(self, kwargs):
+ @staticmethod
+ def _request_class(kwargs):
"""
Get the appropriate class.
@@ -333,7 +334,7 @@
if login_manager.login(retry=True, autocreate=autocreate):
self._username = login_manager.username
del self.userinfo # force reloading
- self.userinfo # load userinfo
+ assert self.userinfo['name'] == self.username() # load userinfo
self._loginstatus = _LoginStatus.AS_USER
else:
self._loginstatus = _LoginStatus.NOT_LOGGED_IN # failure
@@ -517,7 +518,8 @@
'articlepath must end with /$1'
return self.siteinfo['general']['articlepath'][:-2]
- def assert_valid_iter_params(self, msg_prefix, start, end, reverse,
+ @staticmethod
+ def assert_valid_iter_params(msg_prefix, start, end, reverse,
is_ts=True):
"""Validate iterating API parameters.
@@ -836,7 +838,13 @@
# return the magic word without the preceding '#' character
return self.getmagicwords('redirect')[0].lstrip('#')
+ @deprecated('redirect_regex', since='20210103', future_warning=True)
def redirectRegex(self):
+ """Return a compiled regular expression matching on redirect pages."""
+ return self.redirect_regex
+
+ @property
+ def redirect_regex(self):
"""Return a compiled regular expression matching on redirect pages.
Group 1 in the regex match object will be the target title.
@@ -891,9 +899,10 @@
except KeyError:
pywikibot.warning(
'Broken namespace alias "{0}" (id: {1}) on {2}'.format(
- item['*'], item['id'], self))
- if item['*'] not in namespace:
- namespace.aliases.append(item['*'])
+ item['*'], ns, self))
+ else:
+ if item['*'] not in namespace:
+ namespace.aliases.append(item['*'])
return _namespaces
@@ -2227,7 +2236,7 @@
By default, retrieves the last (current) revision of the page,
unless any of the optional parameters revids, startid, endid,
- starttime, endtime, rvdir, user, excludeuser, or limit are
+ starttime, endtime, rvdir, user, excludeuser, or total are
specified. Unless noted below, all parameters not specified
default to False.
@@ -2254,9 +2263,10 @@
@keyword starttime: retrieve revisions starting at this Timestamp
@keyword endtime: stop upon reaching this Timestamp
@keyword rvdir: if false, retrieve newest revisions first (default);
- if true, retrieve earliest first
+ if true, retrieve oldest first
@keyword user: retrieve only revisions authored by this user
@keyword excludeuser: retrieve all revisions not authored by this user
+ @keyword total: number of revisions to retrieve
@raises ValueError: invalid startid/endid or starttime/endtime values
@raises pywikibot.Error: revids belonging to a different page
"""
@@ -4334,13 +4344,12 @@
raise RuntimeError(
'Unexpected success of upload action without parameters.')
- def stash_info(self, file_key, props=False):
+ def stash_info(self, file_key, props=None):
"""Get the stash info for a given file key.
@see: U{https://www.mediawiki.org/wiki/API:Stashimageinfo}
"""
- if not props:
- props = False
+ props = props or False
req = self._simple_request(
action='query', prop='stashimageinfo', siifilekey=file_key,
siiprop=props)
@@ -5584,8 +5593,8 @@
@see: U{https://www.mediawiki.org/wiki/API:Watchlistraw}
- @param force_reload: Reload watchlist
- @type force_reload: bool
+ @param force: Reload watchlist
+ @type force: bool
@param total: if not None, limit the generator to yielding this many
items in total
@type total: int
@@ -6282,7 +6291,7 @@
@param claim: A Claim object to remove the sources from
@type claim: pywikibot.Claim
@param sources: A list of Claim objects that are sources
- @type sources: pywikibot.Claim
+ @type sources: list
@param bot: Whether to mark the edit as a bot edit
@type bot: bool
@param summary: Edit summary
diff --git a/scripts/redirect.py b/scripts/redirect.py
index 9b07caf..21584c5 100755
--- a/scripts/redirect.py
+++ b/scripts/redirect.py
@@ -138,7 +138,7 @@
redict = {}
# open xml dump and read page titles out of it
dump = xmlreader.XmlDump(xmlFilename)
- redirR = self.site.redirectRegex()
+ redirR = self.site.redirect_regex
readPagesCount = 0
pageTitles = set()
for entry in dump.parse():
diff --git a/tests/basesite_tests.py b/tests/basesite_tests.py
index 392789c..96a8395 100644
--- a/tests/basesite_tests.py
+++ b/tests/basesite_tests.py
@@ -107,7 +107,7 @@
self.assertEqual(foo, '[[Foo]]')
self.assertFalse(mysite.isInterwikiLink('foo'))
- self.assertIsInstance(mysite.redirectRegex().pattern, str)
+ self.assertIsInstance(mysite.redirect_regex.pattern, str)
self.assertIsInstance(mysite.category_on_one_line(), bool)
self.assertTrue(mysite.sametitle('Template:Test', 'Template:Test'))
self.assertTrue(mysite.sametitle('Template: Test', 'Template: Test'))
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/653977
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: Icf7ea15683fa8f566acb7b28a7c37b3790bed1a2
Gerrit-Change-Number: 653977
Gerrit-PatchSet: 6
Gerrit-Owner: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged