jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/630603 )
Change subject: [cleanup] Remove deprecated pywikbot.deprecated and pywikibot.deprecate_arg
......................................................................
[cleanup] Remove deprecated pywikbot.deprecated and pywikibot.deprecate_arg
deprecated and deprecate_arg decorators are imported from tools for
all their occurences. The redirected pywikibot functions can be removed
without having a FutureWarning first because they are for internal use
only to deprecate or desupport framework code.
Change-Id: I2a2b1d312a41cffc34ce4a21019cb1cffe84d4a5
---
M pywikibot/__init__.py
1 file changed, 0 insertions(+), 4 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index b855a0e..df21568 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -119,10 +119,6 @@
globals()[_name] = wrapped_func
-deprecated = redirect_func(__deprecated)
-deprecate_arg = redirect_func(_deprecate_arg)
-
-
class Timestamp(datetime.datetime):
"""Class for handling MediaWiki timestamps.
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/630603
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: I2a2b1d312a41cffc34ce4a21019cb1cffe84d4a5
Gerrit-Change-Number: 630603
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/630585 )
Change subject: [cleanup] Cleanup for outdated MediaWiki versions
......................................................................
[cleanup] Cleanup for outdated MediaWiki versions
Change-Id: Ibda7b9a96d26ee05d11f54907c420f2581b99830
---
M pywikibot/data/mysql.py
M pywikibot/page/__init__.py
2 files changed, 12 insertions(+), 11 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/mysql.py b/pywikibot/data/mysql.py
index 620d589..a1c1c77 100644
--- a/pywikibot/data/mysql.py
+++ b/pywikibot/data/mysql.py
@@ -6,6 +6,7 @@
# Distributed under the terms of the MIT license.
#
from contextlib import closing
+from typing import Optional
import pywikibot
@@ -20,7 +21,9 @@
@deprecated_args(encoding=None)
-def mysql_query(query: str, params=None, dbname=None, verbose=None):
+def mysql_query(query: str, params=None,
+ dbname: Optional[str] = None,
+ verbose: Optional[bool] = None):
"""Yield rows from a MySQL query.
An example query that yields all ns0 pages might look like::
@@ -31,19 +34,17 @@
FROM page
WHERE page_namespace = 0;
- From MediaWiki 1.5, all projects use Unicode (UTF-8) character encoding.
+ Supported MediaWiki projects use Unicode (UTF-8) character encoding.
Cursor charset is utf8.
@param query: MySQL query to execute
@param params: input parameters for the query, if needed
if list or tuple, %s shall be used as placeholder in the query string.
if a dict, %(key)s shall be used as placeholder in the query string.
- @type params: tuple, list or dict of str (unicode in py2)
+ @type params: tuple, list or dict of str
@param dbname: db name
- @type dbname: str
@param verbose: if True, print query to be executed;
if None, config.verbose_output will be used.
- @type verbose: None or bool
@return: generator which yield tuples
"""
# These are specified in config2.py or user-config.py
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index 5452121..f819ab0 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -1963,23 +1963,23 @@
@deprecated_args(throttle=True)
def protect(self, edit=False, move=False, create=None, upload=None,
- unprotect=False, reason=None, prompt=None, protections=None,
+ unprotect=False,
+ reason: Optional[str] = None,
+ prompt: Optional[bool] = None,
+ protections: Optional[dict] = None,
**kwargs):
"""
Protect or unprotect a wiki page. Requires administrator status.
- Valid protection levels (in MediaWiki 1.12) are '' (equivalent to
- 'none'), 'autoconfirmed', and 'sysop'. If None is given, however,
+ Valid protection levels are '' (equivalent to 'none'),
+ 'autoconfirmed', and 'sysop'. If None is given, however,
that protection will be skipped.
@param protections: A dict mapping type of protection to protection
level of that type.
- @type protections: dict
@param reason: Reason for the action
- @type reason: basestring
@param prompt: Whether to ask user for confirmation (deprecated).
Defaults to protections is None
- @type prompt: bool
"""
def process_deprecated_arg(value, arg_name):
# if protections was set and value is None, don't interpret that
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/630585
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: Ibda7b9a96d26ee05d11f54907c420f2581b99830
Gerrit-Change-Number: 630585
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/630415 )
Change subject: Update language_groups
......................................................................
Update language_groups
* Add Moroccan Arabic (ary)
* Update comments (fix letter case)
Change-Id: If7322fff9df0d86b8c1a40fd68e39b75af0dd5b9
---
M pywikibot/family.py
1 file changed, 11 insertions(+), 11 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/family.py b/pywikibot/family.py
index 8df90ce..58e2c92 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -560,33 +560,33 @@
# Some languages belong to a group where the possibility is high that
# equivalent articles have identical titles among the group.
language_groups = {
- # languages using the arabic script (incomplete)
+ # languages using the Arabic script (incomplete)
'arab': [
- 'ar', 'arz', 'ps', 'sd', 'ur', 'bjn', 'ckb',
- # languages using multiple scripts, including arabic
+ 'ar', 'ary', 'arz', 'ps', 'sd', 'ur', 'bjn', 'ckb',
+ # languages using multiple scripts, including Arabic
'kk', 'ku', 'tt', 'ug', 'pnb'
],
- # languages that use chinese symbols
+ # languages that use Chinese symbols
'chinese': [
'wuu', 'zh', 'zh-classical', 'zh-yue', 'gan', 'ii',
- # languages using multiple/mixed scripts, including chinese
+ # languages using multiple/mixed scripts, including Chinese
'ja', 'za'
],
- # languages that use the cyrillic alphabet
+ # languages that use the Cyrillic alphabet
'cyril': [
'ab', 'av', 'ba', 'be', 'be-tarask', 'bg', 'bxr', 'ce', 'cu',
'cv', 'kbd', 'koi', 'kv', 'ky', 'mk', 'lbe', 'mdf', 'mn', 'mo',
'myv', 'mhr', 'mrj', 'os', 'ru', 'rue', 'sah', 'tg', 'tk',
'udm', 'uk', 'xal',
- # languages using multiple scripts, including cyrillic
+ # languages using multiple scripts, including Cyrillic
'ha', 'kk', 'sh', 'sr', 'tt'
],
- # languages that use a greek script
+ # languages that use a Greek script
'grec': [
'el', 'grc', 'pnt'
- # languages using multiple scripts, including greek
+ # languages using multiple scripts, including Greek
],
- # languages that use the latin alphabet
+ # languages that use the Latin alphabet
'latin': [
'aa', 'ace', 'af', 'ak', 'als', 'an', 'ang', 'ast', 'ay', 'bar',
'bat-smg', 'bcl', 'bi', 'bm', 'br', 'bs', 'ca', 'cbk-zam', 'cdo',
@@ -607,7 +607,7 @@
'tn', 'to', 'tpi', 'tr', 'ts', 'tum', 'tw', 'ty', 'uz', 've',
'vec', 'vi', 'vls', 'vo', 'wa', 'war', 'wo', 'xh', 'yo', 'zea',
'zh-min-nan', 'zu',
- # languages using multiple scripts, including latin
+ # languages using multiple scripts, including Latin
'az', 'chr', 'ckb', 'ha', 'iu', 'kk', 'ku', 'rmy', 'sh', 'sr',
'tt', 'ug', 'za'
],
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/630415
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: If7322fff9df0d86b8c1a40fd68e39b75af0dd5b9
Gerrit-Change-Number: 630415
Gerrit-PatchSet: 2
Gerrit-Owner: Meno25 <meno25mail(a)gmail.com>
Gerrit-Reviewer: SonarQube Bot <kharlan+sonarqubebot(a)wikimedia.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged