jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/585728 )
Change subject: [doc] Use epytext in PetScanPageGenerator
......................................................................
[doc] Use epytext in PetScanPageGenerator
Change-Id: I2ecc2380b3e5407f6bb1e93d2d39235120ea615f
---
M pywikibot/pagegenerators.py
1 file changed, 10 insertions(+), 10 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 077fddf..0e30c02 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -3016,16 +3016,16 @@
"""
Initializer.
- :param categories: List of categories to retrieve pages from
+ @param categories: List of categories to retrieve pages from
(as strings)
- :param subset_combination: Combination mode.
+ @param subset_combination: Combination mode.
If True, returns the intersection of the results of the categories,
else returns the union of the results of the categories
- :param namespaces: List of namespaces to search in
+ @param namespaces: List of namespaces to search in
(default is None, meaning all namespaces)
- :param site: Site to operate on
+ @param site: Site to operate on
(default is the default site from the user config)
- :param extra_options: Dictionary of extra options to use (optional)
+ @param extra_options: Dictionary of extra options to use (optional)
"""
if site is None:
site = pywikibot.Site()
@@ -3039,13 +3039,13 @@
"""
Get the querystring options to query PetScan.
- :param categories: List of categories (as strings)
- :param subset_combination: Combination mode.
+ @param categories: List of categories (as strings)
+ @param subset_combination: Combination mode.
If True, returns the intersection of the results of the categories,
else returns the union of the results of the categories
- :param namespaces: List of namespaces to search in
- :param extra_options: Dictionary of extra options to use
- :return: Dictionary of querystring parameters to use in the query
+ @param namespaces: List of namespaces to search in
+ @param extra_options: Dictionary of extra options to use
+ @return: Dictionary of querystring parameters to use in the query
"""
extra_options = extra_options or {}
--
To view, visit https://gerrit.wikimedia.org/r/585728
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2ecc2380b3e5407f6bb1e93d2d39235120ea615f
Gerrit-Change-Number: 585728
Gerrit-PatchSet: 3
Gerrit-Owner: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/585068 )
Change subject: [tests] Use meta for TestShortLink
......................................................................
[tests] Use meta for TestShortLink
shared_urlshortner_wiki is meta and pywikibot must be logged in there
Bug: T244062
Change-Id: I3f84d47bc6278d6d1231d4053614809149929ecf
---
M tests/page_tests.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/page_tests.py b/tests/page_tests.py
index 8201445..34b32e7 100644
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -1206,8 +1206,8 @@
user = True
- family = 'wikipedia'
- code = 'test'
+ family = 'meta'
+ code = 'meta'
def test_create_short_link(self):
"""Test create_short_link function."""
--
To view, visit https://gerrit.wikimedia.org/r/585068
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3f84d47bc6278d6d1231d4053614809149929ecf
Gerrit-Change-Number: 585068
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/495740 )
Change subject: mysql: drop support for MySQLdb module
......................................................................
mysql: drop support for MySQLdb module
The PyMySql module has been the default since 72f072f0c and is the
prefered python module. Its advantage over MySQLdb is the module is
pure python and does not depend on having the mysql client to be
installed on the host. It is thus easier to install for end users.
Remove left over legacy support of MySQLdb.
Add a note in HISTORY.rst as a hint.
Note that the code is only used by pagegenerators.py
Bug: T89976
Bug: T243154
Change-Id: Iaa295b27269d40ae6f157635044493566ce39b18
---
M HISTORY.rst
M pywikibot/data/mysql.py
2 files changed, 7 insertions(+), 22 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/HISTORY.rst b/HISTORY.rst
index c6f2898..a182023 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -4,6 +4,8 @@
Current release
---------------
+* pagengenerators.py no more support 'oursql' or 'MySQLdb'. It now solely
+ support PyMySQL https://pypi.org/project/PyMySQL/ (T243154, T89976)
* Bugfixes and improvements
* Localisation updates
diff --git a/pywikibot/data/mysql.py b/pywikibot/data/mysql.py
index 980e9c8..15a6ceb 100644
--- a/pywikibot/data/mysql.py
+++ b/pywikibot/data/mysql.py
@@ -9,21 +9,11 @@
import pywikibot
-# Requires PyMySql as first choice or
-# MySQLdb <https://sourceforge.net/projects/mysql-python/>
try:
- import pymysql as mysqldb
+ import pymysql
except ImportError:
- try:
- import MySQLdb as mysqldb # noqa: N813
- except ImportError:
- raise ImportError('No supported MySQL library installed. '
- 'Please install PyMySQL.')
- else:
- pywikibot.warning("PyMySQL not found. It'll fallback "
- 'on the deprecated library MySQLdb.')
-else:
- mysqldb.install_as_MySQLdb()
+ raise ImportError('MySQL python module not found. Please install PyMySQL.')
+
from pywikibot import config2 as config
from pywikibot.tools import deprecated_args, UnicodeType
@@ -67,7 +57,7 @@
else:
credentials = {'read_default_file': config.db_connect_file}
- conn = mysqldb.connect(config.db_hostname,
+ conn = pymysql.connect(config.db_hostname,
db=config.db_name_format.format(dbname),
port=config.db_port,
charset='utf8',
@@ -76,14 +66,7 @@
cursor = conn.cursor()
if verbose:
- try:
- _query = cursor.mogrify(query, params)
- except AttributeError: # if MySQLdb is used.
- # Not exactly the same encoding handling as cursor.execute()
- # Here it is just for the sake of verbose.
- _query = query
- if params is not None:
- _query = query.format(params)
+ _query = cursor.mogrify(query, params)
if not isinstance(_query, UnicodeType):
_query = UnicodeType(_query, encoding='utf-8')
--
To view, visit https://gerrit.wikimedia.org/r/495740
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iaa295b27269d40ae6f157635044493566ce39b18
Gerrit-Change-Number: 495740
Gerrit-PatchSet: 4
Gerrit-Owner: Hashar <hashar(a)free.fr>
Gerrit-Reviewer: Hashar <hashar(a)free.fr>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Multichill <maarten(a)mdammers.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)
Gerrit-CC: Dvorapa <dvorapa(a)seznam.cz>