jenkins-bot has submitted this change and it was merged.
Change subject: Added links to Mediawiki API docs in some APISite methods
......................................................................
Added links to Mediawiki API docs in some APISite methods
Change-Id: Ice6342f49b7ccde14e1d0e83af0f69ef1014c8f3
---
M pywikibot/site.py
1 file changed, 13 insertions(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 0bbf596..7e0fae9 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -2000,7 +2000,11 @@
return auth_token is not None and len(auth_token) == 4
def login(self, sysop=False):
- """Log the user in if not already logged in."""
+ """
+ Log the user in if not already logged in.
+
+ U{https://www.mediawiki.org/wiki/API:Login}
+ """
# TODO: this should include an assert that loginstatus
# is not already IN_PROGRESS, however the
# login status may be left 'IN_PROGRESS' because
@@ -2069,9 +2073,11 @@
self.login(old_status)
def logout(self):
- """Logout of the site and load details for the logged out user.
+ """
+ Logout of the site and load details for the logged out user.
Also logs out of the global account if linked to the user.
+ U{https://www.mediawiki.org/wiki/API:Logout}
@raises APIError: Logout is not available when OAuth enabled.
"""
@@ -2094,6 +2100,8 @@
- rights: list of rights (could be empty)
- message: present if user has a new message on talk page
- blockinfo: present if user is blocked (dict)
+
+ U{https://www.mediawiki.org/wiki/API:Userinfo}
@param force: force to retrieve userinfo ignoring cache
@type force: bool
@@ -2151,6 +2159,7 @@
To check whether a user can perform an action,
the method has_right should be used.
+ U{https://www.mediawiki.org/wiki/API:Userinfo}
@param sysop: If true, log in to sysop account (if available)
@type sysop: bool
@@ -2234,6 +2243,7 @@
* Actions: edit, move, delete, protect, upload
* User levels: autoconfirmed, sysop, bot
+ U{https://www.mediawiki.org/wiki/API:Userinfo}
"""
if not self.logged_in(sysop):
self.login(sysop)
@@ -2244,6 +2254,7 @@
Possible values of 'group' may vary depending on wiki settings,
but will usually include bot.
+ U{https://www.mediawiki.org/wiki/API:Userinfo}
"""
if not self.logged_in(sysop):
--
To view, visit https://gerrit.wikimedia.org/r/260873
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ice6342f49b7ccde14e1d0e83af0f69ef1014c8f3
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Yujwey <rawzausho(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Do not expand text by default in getCategoryLinks
......................................................................
Do not expand text by default in getCategoryLinks
666364ca introduced wikitext expansion while getting category links,
however this caused magic names like {{PAGENAME}} to be expanded
when it should be kept in the wikitext.
Make this new functionality disabled by default.
Bug: T109213
Change-Id: I321ba1715fe7b1a9c24d7f8109db236339e5f4b5
(cherry picked from commit b28346ab33e0f2d844904bded538f137c7d04cd3)
---
M pywikibot/textlib.py
M tests/textlib_tests.py
2 files changed, 9 insertions(+), 8 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 1f659c9..456940e 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -743,7 +743,7 @@
# Functions dealing with category links
# -------------------------------------
-def getCategoryLinks(text, site=None, include=[]):
+def getCategoryLinks(text, site=None, include=[], expand_text=False):
"""Return a list of category links found in text.
@param include: list of tags which should not be removed by
@@ -763,7 +763,7 @@
R = re.compile(r'\[\[\s*(?P<namespace>%s)\s*:\s*(?P<rest>.+?)\]\]'
% catNamespace, re.I)
for match in R.finditer(text):
- if '{{' in match.group('rest'):
+ if expand_text and '{{' in match.group('rest'):
rest = site.expand_text(match.group('rest'))
else:
rest = match.group('rest')
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index 563f639..e928ade 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -237,24 +237,25 @@
def test_templates(self):
self.site = self.get_site()
self.assertEqual(textlib.getCategoryLinks(
- '[[Category:{{P1|Foo}}]]', self.site),
+ '[[Category:{{P1|Foo}}]]', self.site, expand_text=True),
[pywikibot.page.Category(self.site, 'Foo')])
self.assertEqual(textlib.getCategoryLinks(
- '[[Category:{{P1|Foo}}|bar]]', self.site),
+ '[[Category:{{P1|Foo}}|bar]]', self.site, expand_text=True),
[pywikibot.page.Category(self.site, 'Foo', sortKey='bar')])
self.assertEqual(textlib.getCategoryLinks(
- '[[Category:{{P1|{{P2|L33t|Foo}}}}|bar]]', self.site),
+ '[[Category:{{P1|{{P2|L33t|Foo}}}}|bar]]',
+ self.site, expand_text=True),
[pywikibot.page.Category(self.site, 'Foo', sortKey='bar')])
self.assertEqual(textlib.getCategoryLinks(
- '[[Category:Foo{{!}}bar]]', self.site),
+ '[[Category:Foo{{!}}bar]]', self.site, expand_text=True),
[pywikibot.page.Category(self.site, 'Foo', sortKey='bar')])
self.assertEqual(textlib.getCategoryLinks(
'[[Category:Foo{{!}}bar]][[Category:Wiki{{P2||pedia}}]]',
- self.site),
+ self.site, expand_text=True),
[pywikibot.page.Category(self.site, 'Foo', sortKey='bar'),
pywikibot.page.Category(self.site, 'Wikipedia')])
self.assertEqual(textlib.getCategoryLinks(
- '[[Category:Foo{{!}}and{{!}}bar]]', self.site),
+ '[[Category:Foo{{!}}and{{!}}bar]]', self.site, expand_text=True),
[pywikibot.page.Category(self.site, 'Foo', sortKey='and|bar')])
self.assertRaises(pywikibot.InvalidTitle, textlib.getCategoryLinks,
'[[Category:nasty{{{!}}]]', self.site)
--
To view, visit https://gerrit.wikimedia.org/r/260905
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I321ba1715fe7b1a9c24d7f8109db236339e5f4b5
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: pagegenerators.py: allow filtering by quality level
......................................................................
pagegenerators.py: allow filtering by quality level
Allow filtering by quality when page site has ProofreadPage extension
and requested pages are ProofreadPage pages.
Add related tests in page_generators_tests.py.
Add ProofreadPage.quality_level property for pages and related tests.
Bug: T122047
Change-Id: I93ff113f0fa3701b830a8589a955e0f35814b2a2
---
M pywikibot/pagegenerators.py
M pywikibot/proofreadpage.py
M tests/pagegenerators_tests.py
M tests/proofreadpage_tests.py
4 files changed, 123 insertions(+), 3 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index e205ff6..d3a15a9 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -48,7 +48,8 @@
from pywikibot import date, config, i18n, xmlreader
from pywikibot.comms import http
-from pywikibot.exceptions import ArgumentDeprecationWarning
+from pywikibot.exceptions import ArgumentDeprecationWarning, UnknownExtension
+from pywikibot.proofreadpage import ProofreadPage
if sys.version_info[0] > 2:
basestring = (str, )
@@ -278,6 +279,12 @@
Case insensitive regular expressions will be used and
dot matches any character, including a newline.
+-ql Filter pages based on page quality.
+ This is only applicable if contentmodel equals
+ 'proofread-page', otherwise has no effects.
+ Valid values are in range 0-4.
+ Multiple values can be comma-separated.
+
-onlyif A claim the page needs to contain, otherwise the item won't
be returned.
The format is property=value,qualifier=value. Multiple (or
@@ -339,6 +346,7 @@
self._namespaces = []
self.step = None
self.limit = None
+ self.qualityfilter_list = []
self.articlefilter_list = []
self.titlefilter_list = []
self.claimfilter_list = []
@@ -411,8 +419,11 @@
if self.limit:
self.gens[i] = itertools.islice(self.gens[i], self.limit)
if len(self.gens) == 0:
- if self.titlefilter_list or self.articlefilter_list or \
- self.claimfilter_list or self.subpage_max_depth is not None:
+ if (self.titlefilter_list or
+ self.articlefilter_list or
+ self.claimfilter_list or
+ self.subpage_max_depth is not None or
+ self.qualityfilter_list):
pywikibot.warning(
'filter(s) specified but no generators.')
return None
@@ -442,6 +453,10 @@
dupfiltergen = ItemClaimFilterPageGenerator(dupfiltergen,
claim[0], claim[1],
claim[2], claim[3])
+
+ if self.qualityfilter_list:
+ dupfiltergen = QualityFilterPageGenerator(
+ dupfiltergen, self.qualityfilter_list)
if self.titlefilter_list:
dupfiltergen = RegexFilterPageGenerator(
@@ -777,6 +792,19 @@
u'Which pattern do you want to grep?'))
else:
self.articlefilter_list.append(arg[6:])
+ return True
+ elif arg.startswith('-ql:'):
+ if not self.site.has_extension('ProofreadPage'):
+ raise UnknownExtension(
+ 'Ql filtering needs a site with ProofreadPage extension.')
+ value = map(int, arg[4:].split(','))
+ if min(value) < 0 or max(value) > 4: # Invalid input ql.
+ valid_ql = ['{0}: {1}'.format(*i) for
+ i in self.site.proofread_levels.items()]
+ valid_ql = ', '.join(valid_ql)
+ pywikibot.warning('Acceptable values for -ql are:\n %s'
+ % valid_ql)
+ self.qualityfilter_list = value
return True
elif arg.startswith('-onlyif') or arg.startswith('-onlyifnot'):
ifnot = arg.startswith('-onlyifnot')
@@ -1501,6 +1529,27 @@
return (page for page in generator
if cls.__filter_match(reg, page.text, quantifier))
+
+def QualityFilterPageGenerator(generator, quality):
+ """
+ Wrap a generator to filter pages according to quality levels.
+
+ This is possible only for pages with content_model 'proofread-page'.
+ In all the other cases, no filter is applied.
+
+ @param generator: A generator object
+ @param quality: proofread-page quality levels (valid range 0-4)
+ @type quality: list of int
+
+ """
+ for page in generator:
+ if page.namespace() == page.site.proofread_page_ns:
+ page = ProofreadPage(page)
+ if page.quality_level in quality:
+ yield page
+ else:
+ yield page
+
# name the generator methods
RegexFilterPageGenerator = RegexFilter.titlefilter
RegexBodyFilterPageGenerator = RegexFilter.contentfilter
diff --git a/pywikibot/proofreadpage.py b/pywikibot/proofreadpage.py
index 5d0e9ba..5996ee7 100644
--- a/pywikibot/proofreadpage.py
+++ b/pywikibot/proofreadpage.py
@@ -161,6 +161,26 @@
if hasattr(self, "_index"):
del self._index
+ @property
+ def quality_level(self):
+ """Return the quality level of this page when it is retrieved from API.
+
+ This is only applicable if contentmodel equals 'proofread-page'.
+ None is returned otherwise.
+
+ This property is read-only and is applicable only when page is loaded.
+ If quality level is overwritten during page processing, this property
+ is no longer necessarily aligned with the new value.
+
+ In this way, no text parsing is necessary to check quality level when
+ fetching a page.
+ # TODO: align this value with ProofreadPage.ql
+
+ """
+ if self.content_model == 'proofread-page' and hasattr(self, '_quality'):
+ return self._quality
+ return self.ql
+
def decompose(fn):
"""Decorator.
diff --git a/tests/pagegenerators_tests.py b/tests/pagegenerators_tests.py
index 3936fca..ed38066 100755
--- a/tests/pagegenerators_tests.py
+++ b/tests/pagegenerators_tests.py
@@ -19,6 +19,8 @@
import pywikibot
from pywikibot import pagegenerators, date
+from pywikibot.exceptions import UnknownExtension
+
from pywikibot.pagegenerators import (
PagesFromTitlesGenerator,
PreloadingGenerator,
@@ -179,6 +181,33 @@
gen = pagegenerators.RegexBodyFilterPageGenerator(iter(pages), 'talk',
quantifier='none')
self.assertEqual(len(tuple(gen)), 9)
+
+
+class TestQualityFilterPageGenerator(TestCase):
+
+ """Test QualityFilterPageGenerator methods."""
+
+ family = 'wikisource'
+ code = 'en'
+
+ cached = True
+
+ base_title = 'Page:Popular Science Monthly Volume 1.djvu/%s'
+
+ def setUp(self):
+ super(TestQualityFilterPageGenerator, self).setUp()
+ self.site = self.get_site()
+ self.titles = [self.base_title % i for i in range(1, 11)]
+
+ def test_QualityFilterPageGenerator(self):
+ site = self.site
+ gen = pagegenerators.PagesFromTitlesGenerator(self.titles, site)
+ gen = pagegenerators.QualityFilterPageGenerator(gen, [0])
+ self.assertEqual(len(tuple(gen)), 7)
+ gen = pagegenerators.PagesFromTitlesGenerator(self.titles, site)
+ gen = pagegenerators.NamespaceFilterPageGenerator(gen, [4])
+ gen = pagegenerators.PagesFromTitlesGenerator(self.titles, site)
+ self.assertEqual(len(tuple(gen)), 10)
class EdittimeFilterPageGeneratorTestCase(TestCase):
@@ -511,6 +540,10 @@
gf.handleArg('-ns:0')
self.assertEqual(gf.namespaces, set([1, 6]))
+ def test_unsupported_quality_level_filter(self):
+ gf = pagegenerators.GeneratorFactory(site=self.get_site())
+ self.assertRaises(UnknownExtension, gf.handleArg, '-ql:2')
+
class TestItemClaimFilterPageGenerator(WikidataTestCase):
diff --git a/tests/proofreadpage_tests.py b/tests/proofreadpage_tests.py
index 6e517cd..39b464b 100644
--- a/tests/proofreadpage_tests.py
+++ b/tests/proofreadpage_tests.py
@@ -207,6 +207,24 @@
self.assertEqual(json.loads(page_text), json.loads(loaded_text))
+class TestPageQuality(TestCase):
+
+ """Test page quality."""
+
+ family = 'wikisource'
+ code = 'en'
+
+ cached = True
+
+ def test_applicable_quality_level(self):
+ """Test Page.quality_level when applicable."""
+ site = self.get_site()
+ title = 'Page:Popular Science Monthly Volume 49.djvu/1'
+ page = ProofreadPage(site, title)
+ self.assertEqual(page.content_model, 'proofread-page')
+ self.assertEqual(page.quality_level, 0)
+
+
@require_modules('bs4')
class TestProofreadPageIndexProperty(TestCase):
--
To view, visit https://gerrit.wikimedia.org/r/250221
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I93ff113f0fa3701b830a8589a955e0f35814b2a2
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Do not expand text by default in getCategoryLinks
......................................................................
Do not expand text by default in getCategoryLinks
666364ca introduced wikitext expansion while getting category links,
however this caused magic names like {{PAGENAME}} to be expanded
when it should be kept in the wikitext.
Make this new functionality disabled by default.
Bug: T109213
Change-Id: I321ba1715fe7b1a9c24d7f8109db236339e5f4b5
---
M pywikibot/textlib.py
M tests/textlib_tests.py
2 files changed, 9 insertions(+), 8 deletions(-)
Approvals:
Mpaa: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 05e0b8b..0fe92e0 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -993,7 +993,7 @@
# Functions dealing with category links
# -------------------------------------
-def getCategoryLinks(text, site=None, include=[]):
+def getCategoryLinks(text, site=None, include=[], expand_text=False):
"""Return a list of category links found in text.
@param include: list of tags which should not be removed by
@@ -1013,7 +1013,7 @@
R = re.compile(r'\[\[\s*(?P<namespace>%s)\s*:\s*(?P<rest>.+?)\]\]'
% catNamespace, re.I)
for match in R.finditer(text):
- if '{{' in match.group('rest'):
+ if expand_text and '{{' in match.group('rest'):
rest = site.expand_text(match.group('rest'))
else:
rest = match.group('rest')
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index 762f62d..6b674a8 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -265,24 +265,25 @@
"""Test normal templates inside category links."""
self.site = self.get_site()
self.assertEqual(textlib.getCategoryLinks(
- '[[Category:{{P1|Foo}}]]', self.site),
+ '[[Category:{{P1|Foo}}]]', self.site, expand_text=True),
[pywikibot.page.Category(self.site, 'Foo')])
self.assertEqual(textlib.getCategoryLinks(
- '[[Category:{{P1|Foo}}|bar]]', self.site),
+ '[[Category:{{P1|Foo}}|bar]]', self.site, expand_text=True),
[pywikibot.page.Category(self.site, 'Foo', sortKey='bar')])
self.assertEqual(textlib.getCategoryLinks(
- '[[Category:{{P1|{{P2|L33t|Foo}}}}|bar]]', self.site),
+ '[[Category:{{P1|{{P2|L33t|Foo}}}}|bar]]',
+ self.site, expand_text=True),
[pywikibot.page.Category(self.site, 'Foo', sortKey='bar')])
self.assertEqual(textlib.getCategoryLinks(
- '[[Category:Foo{{!}}bar]]', self.site),
+ '[[Category:Foo{{!}}bar]]', self.site, expand_text=True),
[pywikibot.page.Category(self.site, 'Foo', sortKey='bar')])
self.assertEqual(textlib.getCategoryLinks(
'[[Category:Foo{{!}}bar]][[Category:Wiki{{P2||pedia}}]]',
- self.site),
+ self.site, expand_text=True),
[pywikibot.page.Category(self.site, 'Foo', sortKey='bar'),
pywikibot.page.Category(self.site, 'Wikipedia')])
self.assertEqual(textlib.getCategoryLinks(
- '[[Category:Foo{{!}}and{{!}}bar]]', self.site),
+ '[[Category:Foo{{!}}and{{!}}bar]]', self.site, expand_text=True),
[pywikibot.page.Category(self.site, 'Foo', sortKey='and|bar')])
self.assertRaises(pywikibot.InvalidTitle, textlib.getCategoryLinks,
'[[Category:nasty{{{!}}]]', self.site)
--
To view, visit https://gerrit.wikimedia.org/r/258782
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I321ba1715fe7b1a9c24d7f8109db236339e5f4b5
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Add explanations for ignored flake8 codes
......................................................................
Add explanations for ignored flake8 codes
Change-Id: I6406b03d0e4c5af9a15fd05eb958070877755bed
---
M tox.ini
1 file changed, 21 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tox.ini b/tox.ini
index ac5a94b..b737fee 100644
--- a/tox.ini
+++ b/tox.ini
@@ -78,6 +78,25 @@
-rdocs/requirements-py3.txt
[flake8]
+# The following are intentionally ignored, possibly pending consensus
+# D105: Missing docstring in magic method
+# D211: No blank lines allowed before class docstring
+# FI10,FI12,FI13,FI15: __future__ import "division", "with_statement", "print_function" and "generator_stop" missing
+# FI5: __future__ import "x" present
+# H101: TODO format
+# H236: Mandatory use of six for Python 2 & 3 metaclass support
+# H404: docstring multiline start
+# H405: docstring summary line
+# H301,I100,I101: import order rules; Pywikibot uses rules H306 and I201
+
+# The following are to be fixed
+# D102: Missing docstring in public method
+# D103: Missing docstring in public function
+# E402: module level import not at top of file; see T87409
+# E731: do not assign a lambda expression, use a def; see I7b3db838
+# H201: Except: format
+# H202: assertRaises Exception too broad
+# P102,P103: string does contain unindexed parameters; see I36355923
ignore = E402,E731,D105,D211,FI10,FI12,FI13,FI15,FI5,H101,H201,H202,H236,H301,H404,H405,I100,I101,P102,P103
exclude = .tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/*
max_line_length = 130
@@ -97,9 +116,11 @@
scripts/catall.py,scripts/imageharvest.py,scripts/makecat.py,scripts/maintenance/cache.py,scripts/maintenance/wikimedia_sites.py : +D103
[pep8]
+# see explanations above
ignore = E402,E731
exclude = .tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/*
max_line_length = 130
[pep257]
+# see explanations above
ignore = D105,D211
--
To view, visit https://gerrit.wikimedia.org/r/247077
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6406b03d0e4c5af9a15fd05eb958070877755bed
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Fix invalid raise syntax in askForCaptcha
......................................................................
Fix invalid raise syntax in askForCaptcha
A base raise statement can only exist inside an `except:` clause.
Added in compat:
https://www.mediawiki.org/wiki/Special:Code/pywikipedia/7214
askForCaptcha is unused in core (T122194).
Change-Id: I308379e47a574dd62d1cddd73253fc3171f10dbf
---
M pywikibot/userinterfaces/terminal_interface_base.py
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/userinterfaces/terminal_interface_base.py b/pywikibot/userinterfaces/terminal_interface_base.py
index 4540e2c..66aad34 100755
--- a/pywikibot/userinterfaces/terminal_interface_base.py
+++ b/pywikibot/userinterfaces/terminal_interface_base.py
@@ -443,8 +443,9 @@
u'What is the solution of the CAPTCHA that is shown in '
u'your web browser?')
else:
- raise
- except:
+ raise webbrowser.Error(
+ 'webbrowser.open failed to open a web browser')
+ except Exception:
pywikibot.output(u'Error in opening web browser: %s'
% sys.exc_info()[0])
pywikibot.output(
--
To view, visit https://gerrit.wikimedia.org/r/260557
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I308379e47a574dd62d1cddd73253fc3171f10dbf
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
Xqt has submitted this change and it was merged.
Change subject: Typo fix
......................................................................
Typo fix
Change-Id: I2b273f1c5c56fd3aebd9959ad250c2f9c5f7a431
---
M scripts/welcome.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/welcome.py b/scripts/welcome.py
index b77d9e2..ea36244 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -151,7 +151,7 @@
* *
* The regex to load the user might be slightly different from project to *
* project. (In this case, write to Filnik or the PWRF for help...) *
-* Use a class to group toghether the functions used. *
+* Use a class to group together the functions used. *
* *
******************************** Badwords **********************************
@@ -164,7 +164,7 @@
or deleting.
Some words, like "Administrator" or "Dio" (God in italian) or "Jimbo" aren't
-badword at all but can be used for some bad-nickname.
+badwords at all but can be used for some bad-nickname.
"""
#
# (C) Alfio, 2005
--
To view, visit https://gerrit.wikimedia.org/r/260899
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2b273f1c5c56fd3aebd9959ad250c2f9c5f7a431
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Hazard-SJ <hazardsjwiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Typo fix
......................................................................
Typo fix
Change-Id: I7553a1a72a02025d03ad857c3481ed636da51776
---
M scripts/welcome.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/welcome.py b/scripts/welcome.py
index 8e4995a..7ebcfa6 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -151,7 +151,7 @@
* *
* The regex to load the user might be slightly different from project to *
* project. (In this case, write to Filnik or the PWRF for help...) *
-* Use a class to group toghether the functions used. *
+* Use a class to group together the functions used. *
* *
******************************** Badwords **********************************
@@ -164,7 +164,7 @@
or deleting.
Some words, like "Administrator" or "Dio" (God in italian) or "Jimbo" aren't
-badword at all but can be used for some bad-nickname.
+badwords at all but can be used for some bad-nickname.
"""
#
# (C) Alfio, 2005
--
To view, visit https://gerrit.wikimedia.org/r/260860
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7553a1a72a02025d03ad857c3481ed636da51776
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Hazard-SJ <hazardsjwiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>