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 <[email protected]>
Gerrit-Reviewer: Mpaa <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits