jenkins-bot has submitted this change and it was merged.
Change subject: Set __name__ on generated test functions
......................................................................
Set __name__ on generated test functions
When tests.aspects creates multiple tests for a specified list
of sites, it was setting the name of the generated test in the
test class dictionary, but nose 2.7 also needs the generated test
function to have __name__ set.
Change-Id: I5687ec91dba68ffa671641c6c219f6a20bc5a84e
---
M tests/aspects.py
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/aspects.py b/tests/aspects.py
index 2dfcc09..1f6861c 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -850,6 +850,7 @@
test_name = test + '_' + key.replace('-', '_')
dct[test_name] = wrap_method(key, sitedata, dct[test])
+ dct[test_name].__name__ = str(test_name)
if key in dct.get('expected_failures', []):
dct[test_name] = unittest.expectedFailure(dct[test_name])
--
To view, visit https://gerrit.wikimedia.org/r/243817
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5687ec91dba68ffa671641c6c219f6a20bc5a84e
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: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Remove guildwars test
......................................................................
[FIX] Remove guildwars test
The guildwars.wikia.com wiki has blocked the resource for the Travis tests.
This removes it for now so that the tests do not fail.
Bug: T114639
Change-Id: I36137e6556147241b46d3e85f027505c2026b67d
---
M tests/site_detect_tests.py
1 file changed, 0 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/site_detect_tests.py b/tests/site_detect_tests.py
index 2da5730..6a8ea4a 100644
--- a/tests/site_detect_tests.py
+++ b/tests/site_detect_tests.py
@@ -170,7 +170,6 @@
def test_detect_site(self):
"""Test detection of MediaWiki sites."""
self.assertSite('http://botwiki.sno.cc/wiki/$1')
- self.assertSite('http://guildwars.wikia.com/wiki/$1')
self.assertSite('http://www.hrwiki.org/index.php/$1') # v 1.15
self.assertSite('http://www.proofwiki.org/wiki/$1')
self.assertSite(
--
To view, visit https://gerrit.wikimedia.org/r/243822
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I36137e6556147241b46d3e85f027505c2026b67d
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: proofreadpage.py: purge IndexPage when Index has no required class set
......................................................................
proofreadpage.py: purge IndexPage when Index has no required class set
Purge index if class="qualityN prp-pagequality-N" is not found in HTML
parsing of IndexPage.
Raise ValueError if page.purge() has no effect.
Bug: T114318
Change-Id: I342df4e5b5e2743dbb5bdb8f55296e07242b6b58
---
M pywikibot/proofreadpage.py
1 file changed, 10 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/proofreadpage.py b/pywikibot/proofreadpage.py
index a14e2f2..1bc70cd 100644
--- a/pywikibot/proofreadpage.py
+++ b/pywikibot/proofreadpage.py
@@ -385,6 +385,16 @@
# href="/wiki/Page:xxx.djvu/n"
# title="Page:xxx.djvu/n">m
# </a>
+ # Try to purge or raise ValueError.
+ if not self._soup.find_all('a', attrs=attrs):
+ self.purge()
+ del self._parsed_text
+ self._parsed_text = self._get_parsed_page()
+ self._soup = BeautifulSoup(self._parsed_text, 'html.parser')
+ if not self._soup.find_all('a', attrs=attrs):
+ raise ValueError(
+ 'Missing class="qualityN prp-pagequality-N" in: %s.'
+ % self)
page_cnt = 0
for a_tag in self._soup.find_all('a', attrs=attrs):
--
To view, visit https://gerrit.wikimedia.org/r/243032
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I342df4e5b5e2743dbb5bdb8f55296e07242b6b58
Gerrit-PatchSet: 3
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: Fix TranslationError when fallback=False
......................................................................
Fix TranslationError when fallback=False
When fallback is False, TranslationError may occur when the requested
language was not English. The TranslationError exception message
assumed the error could only occur when an English message is missing.
Change-Id: Iac76961dbf61d5221a4db3fb5e6e113499221e2a
---
M pywikibot/i18n.py
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py
index 4a7d5d0..ee2bb92 100644
--- a/pywikibot/i18n.py
+++ b/pywikibot/i18n.py
@@ -504,9 +504,11 @@
break
else:
raise TranslationError(
- 'No English translation has been defined for TranslateWiki key'
+ 'No %s translation has been defined for TranslateWiki key'
' %r\nIt can happen due to lack of i18n submodule or files. '
- 'Read https://mediawiki.org/wiki/PWB/i18n' % twtitle)
+ 'Read https://mediawiki.org/wiki/PWB/i18n'
+ % ('English' if 'en' in langs else "'%s'" % lang,
+ twtitle))
# send the language code back via the given list
if code_needed:
code.append(alt)
--
To view, visit https://gerrit.wikimedia.org/r/243622
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iac76961dbf61d5221a4db3fb5e6e113499221e2a
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: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [bugfix] use site.lang for twtranslate
......................................................................
[bugfix] use site.lang for twtranslate
twtranslate uses site.code by default. This breaks translations for some wikis.
Change-Id: Ibef1be0765343933b9df9275395aad1e52ee6752
---
M scripts/checkimages.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index e7c5cbc..fdddb9b 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -582,7 +582,7 @@
for tmp in hiddentemplatesRaw])
self.pageHidden = i18n.translate(self.site, PageWithHiddenTemplates)
self.pageAllowed = i18n.translate(self.site, PageWithAllowedTemplates)
- self.comment = i18n.twtranslate(self.site,
+ self.comment = i18n.twtranslate(self.site.lang,
'checkimages-source-tag-comment',
fallback=False)
# Adding the bot's nickname at the notification text if needed.
@@ -740,7 +740,7 @@
def put_mex_in_talk(self):
"""Function to put the warning in talk page of the uploader."""
- commento2 = i18n.twtranslate(self.site,
+ commento2 = i18n.twtranslate(self.site.lang,
'checkimages-source-notice-comment')
emailPageName = i18n.translate(self.site, emailPageWithText)
emailSubj = i18n.translate(self.site, emailSubject)
--
To view, visit https://gerrit.wikimedia.org/r/243624
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibef1be0765343933b9df9275395aad1e52ee6752
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] nowcommons: Query at most one users
......................................................................
[IMPROV] nowcommons: Query at most one users
To verify if a page is used it's only necessary to query one using page instead
of all.
Conflicts:
scripts/nowcommons.py
Change-Id: I9bbb206ede1723c33410c3b50e05dae71ecc265f
---
M scripts/nowcommons.py
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/nowcommons.py b/scripts/nowcommons.py
index b462ec7..3e4e5b7 100755
--- a/scripts/nowcommons.py
+++ b/scripts/nowcommons.py
@@ -369,9 +369,9 @@
oImageRobot.run()
# If the image is used with the urlname the
# previous function won't work
- if len(list(pywikibot.FilePage(self.site,
- page.title()).usingPages())) > 0 and \
- self.getOption('replaceloose'):
+ is_used = bool(list(pywikibot.FilePage(
+ self.site, page.title()).usingPages(total=1)))
+ if is_used and self.getOption('replaceloose'):
oImageRobot = image.ImageRobot(
pg.FileLinksGenerator(
localImagePage),
--
To view, visit https://gerrit.wikimedia.org/r/243507
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9bbb206ede1723c33410c3b50e05dae71ecc265f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #2969
Status: Failed
Duration: 19 minutes and 10 seconds
Commit: 71918b5 (master)
Author: John Vandenberg
Message: Require bs4 for IndexPage BasePage tests
458dd0ac introduced tests for BasePage methods to IndexPage,
however these tests can only be run when bs4 is available.
Change-Id: Ief32075086d36368082283ded8c87cd0e4c0a891
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/5b659cb66ea1...71918b59…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/83614317
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications