jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] category: Use Category instance for title
......................................................................
[FIX] category: Use Category instance for title
With acf2280a83c1518982d14add67d6b6e51e4fa69c nocapitalize was
deprecated and replaced by checking the namespace's setting. By doing
that category accidentally didn't check in the site but just using
'self' similar to T91234.
This now uses the functionality of Category (which uses Link for that).
Change-Id: I049a0e6e8739161ee054cb34e4f5c58f6116bd89
---
M scripts/category.py
1 file changed, 2 insertions(+), 5 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/category.py b/scripts/category.py
index 1db584f..51bb82a 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -350,10 +350,7 @@
pywikibot.output(u"Current categories:")
for cat in cats:
pywikibot.output(u"* %s" % cat.title())
- newcat = self.newcat
- if self.namespaces[14].case == 'first-letter':
- newcat = newcat[:1].upper() + newcat[1:]
- catpl = pywikibot.Category(self.current_page.site, newcat)
+ catpl = pywikibot.Category(self.current_page.site, self.newcat)
if catpl in cats:
pywikibot.output(u"%s is already in %s."
% (self.current_page.title(), catpl.title()))
@@ -368,7 +365,7 @@
if not comment:
comment = i18n.twtranslate(self.current_page.site,
'category-adding',
- {'newcat': newcat})
+ {'newcat': catpl.title(withNamespace=False)})
try:
self.userPut(self.current_page, old_text, text,
comment=comment, minor=True, botflag=True)
--
To view, visit https://gerrit.wikimedia.org/r/194396
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I049a0e6e8739161ee054cb34e4f5c58f6116bd89
Gerrit-PatchSet: 3
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: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ricordisamoa <ricordisamoa(a)openmailbox.org>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #2042
Status: Failed
Duration: 46 minutes and 8 seconds
Commit: f903c8c (master)
Author: Fabian Neundorf
Message: [FIX] travis: Use unittest2 0.8.0
Because of T74801 in e40c9a4baa9901568b47e6b30e6019d1a51f6a87 the
unitttest2 version was limited to 0.6.0 but that is causing version
conflicts recently and the Python 2.6 tests fail. But since
fca702e7a2f929256dc4f12ed60bdb7408c1872e expectedFailure tests have been
changed into allowed_failure tests and thus don't cause a problem
anymore. This now installs the required version 0.8.0.
Bug: T92277
Change-Id: I600c014953f9b26029cecde99190a700a4eb07e9
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/80030162f281...f903c8c8…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/53852459
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] travis: Use unittest2 0.8.0
......................................................................
[FIX] travis: Use unittest2 0.8.0
Because of T74801 in e40c9a4baa9901568b47e6b30e6019d1a51f6a87 the
unitttest2 version was limited to 0.6.0 but that is causing version
conflicts recently and the Python 2.6 tests fail. But since
fca702e7a2f929256dc4f12ed60bdb7408c1872e expectedFailure tests have been
changed into allowed_failure tests and thus don't cause a problem
anymore. This now installs the required version 0.8.0.
Bug: T92277
Change-Id: I600c014953f9b26029cecde99190a700a4eb07e9
---
M .travis.yml
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.travis.yml b/.travis.yml
index cea9360..f7d58c0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,7 +13,7 @@
install:
- if [[ "$SITE_ONLY" == '1' ]]; then export USE_NOSE=1; fi
- - if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2==0.6.0; fi
+ - if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2==0.8.0; fi
- pip install six
- export GITHUB_USER=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 1`
- mkdir ~/.pywikibot
--
To view, visit https://gerrit.wikimedia.org/r/195610
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I600c014953f9b26029cecde99190a700a4eb07e9
Gerrit-PatchSet: 3
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: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #2041
Status: Errored
Duration: 22 minutes and 43 seconds
Commit: 8003016 (master)
Author: Fabian Neundorf
Message: [FIX] replace: Allow tuples of two again
With babc7cef9b7805b0bb8c2b5abab4b715e7fc1e7a the replacements needed to
be a list of Replacement instances, but some scripts might call it still
with a list of tuples. This now supports any sequence as long as it has
two entries in it and converts them into Replacement instances.
Bug: T90016
Change-Id: I257badc80a70fc836b9d452402bae75faf2141b1
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/ff893da7a1ef...80030162…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/53798395
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] replace: Allow tuples of two again
......................................................................
[FIX] replace: Allow tuples of two again
With babc7cef9b7805b0bb8c2b5abab4b715e7fc1e7a the replacements needed to
be a list of Replacement instances, but some scripts might call it still
with a list of tuples. This now supports any sequence as long as it has
two entries in it and converts them into Replacement instances.
Bug: T90016
Change-Id: I257badc80a70fc836b9d452402bae75faf2141b1
---
M scripts/replace.py
1 file changed, 24 insertions(+), 5 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/replace.py b/scripts/replace.py
index efbb9c6..5c57a4f 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -125,6 +125,7 @@
__version__ = '$Id$'
#
+import collections
import re
import time
import sys
@@ -209,6 +210,15 @@
self._use_regex = use_regex
self.exceptions = exceptions
self._case_insensitive = case_insensitive
+
+ @classmethod
+ def from_compiled(cls, old_regex, new, **kwargs):
+ """Create instance from already compiled regex."""
+ if kwargs.get('use_regex', True) is not True:
+ raise ValueError('The use_regex parameter can only be True.')
+ repl = cls(old_regex.pattern, new, **kwargs)
+ repl.old_regex = old_regex
+ return repl
@property
def case_insensitive(self):
@@ -393,9 +403,10 @@
Arguments:
* generator - A generator that yields Page objects.
- * replacements - A list of 2-tuples of original text (as a
- compiled regular expression) and replacement
- text (as a string).
+ * replacements - A list of Replacement instances or sequences of
+ length 2 with the original text (as a compiled
+ regular expression) and replacement text (as a
+ string).
* exceptions - A dictionary which defines when not to change an
occurrence. See below.
* acceptall - If True, the user won't be prompted before changes
@@ -424,8 +435,16 @@
exceptionRegexes dictionary in textlib.replaceExcept().
"""
- super(ReplaceRobot, self).__init__()
- self.generator = generator
+ super(ReplaceRobot, self).__init__(generator=generator)
+ for i, replacement in enumerate(replacements):
+ if isinstance(replacement, collections.Sequence):
+ if len(replacement) != 2:
+ raise ValueError('Replacement number {0} does not have '
+ 'exactly two elements: {1}'.format(
+ i, replacement))
+ # Replacement assumes it gets strings but it's already compiled
+ replacements[i] = Replacement.from_compiled(replacement[0],
+ replacement[1])
self.replacements = replacements
self.exceptions = exceptions
self.acceptall = acceptall
--
To view, visit https://gerrit.wikimedia.org/r/195545
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I257badc80a70fc836b9d452402bae75faf2141b1
Gerrit-PatchSet: 3
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: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #2039
Status: Failed
Duration: 29 minutes and 18 seconds
Commit: 7412dbf (master)
Author: Fabian Neundorf
Message: [FIX] socketIO: Use older version to support WMF
The WMF is using socket.io 0.9 but the newest version of socketIO_client
(0.6.1) supports only socket.io 1.0. That causes a 404 error and makes
it unusuable. Use the latest version which still support 0.9. See also
T91393.
Bug: T85716
Change-Id: Icf10f7f907baaf346ad1e37400685853e4d774fe
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/33a2a4dd4b9a...7412dbfb…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/53785655
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications