jenkins-bot has submitted this change and it was merged.
Change subject: [bugfix] Fix deprecation warning for namespace shortcuts
......................................................................
[bugfix] Fix deprecation warning for namespace shortcuts
namespaces.CONSTANT gives the Namespace object not the string.
Assigning Namespace to a string adds a colon and prepends one for
FILE and CATEGORY Namespace because Namespace.__str__ uses the
canonical_prefix method whereas the old shortcuts gives the default
localized name which is custom_name property. The deprecation warning
should follow this issue.
Change-Id: Idaa5e28dccbdd0311b617ec8607c4bbc96d88fa7
---
M pywikibot/site.py
1 file changed, 5 insertions(+), 5 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index c421fbf..b8c69ea 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -1168,27 +1168,27 @@
# namespace shortcuts for backwards-compatibility
- @deprecated('namespaces.SPECIAL')
+ @deprecated('namespaces.SPECIAL.custom_name')
def special_namespace(self):
"""Return local name for the Special: namespace."""
return self.namespace(-1)
- @deprecated('namespaces.FILE')
+ @deprecated('namespaces.FILE.custom_name')
def image_namespace(self):
"""Return local name for the File namespace."""
return self.namespace(6)
- @deprecated('namespaces.MEDIAWIKI')
+ @deprecated('namespaces.MEDIAWIKI.custom_name')
def mediawiki_namespace(self):
"""Return local name for the MediaWiki namespace."""
return self.namespace(8)
- @deprecated('namespaces.TEMPLATE')
+ @deprecated('namespaces.TEMPLATE.custom_name')
def template_namespace(self):
"""Return local name for the Template namespace."""
return self.namespace(10)
- @deprecated('namespaces.CATEGORY')
+ @deprecated('namespaces.CATEGORY.custom_name')
def category_namespace(self):
"""Return local name for the Category namespace."""
return self.namespace(14)
--
To view, visit https://gerrit.wikimedia.org/r/282180
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Idaa5e28dccbdd0311b617ec8607c4bbc96d88fa7
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: [doc] Remove template documentation which is not very helpful here
......................................................................
[doc] Remove template documentation which is not very helpful here
Also move replacements instantiating where it is needed.
Change-Id: I78d30fc0642934bfa5aa8b9e48a8d875461881e1
---
M scripts/image.py
1 file changed, 1 insertion(+), 8 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/image.py b/scripts/image.py
index c826178..81ec66d 100755
--- a/scripts/image.py
+++ b/scripts/image.py
@@ -131,14 +131,6 @@
else self.old_image,
fallback=True)
- # regular expression to find the original template.
- # {{vfd}} does the same thing as {{Vfd}}, so both will be found.
- # The old syntax, {{msg:vfd}}, will also be found.
- # The group 'parameters' will either match the parameters, or an
- # empty string if there are none.
-
- replacements = []
-
namespace = self.site.namespaces[6]
if namespace.case == 'first-letter':
case = re.escape(self.old_image[0].upper() +
@@ -156,6 +148,7 @@
else:
image_regex = re.compile(r'' + escaped)
+ replacements = []
if self.new_image:
if not self.getOption('loose'):
replacements.append((image_regex,
--
To view, visit https://gerrit.wikimedia.org/r/282199
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I78d30fc0642934bfa5aa8b9e48a8d875461881e1
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(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: [doc] remove lonely comment
......................................................................
[doc] remove lonely comment
Change-Id: I42135fff6b045f65cbcb629daca2b3827a345204
---
M scripts/template.py
1 file changed, 0 insertions(+), 6 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/template.py b/scripts/template.py
index 783da18..854533e 100755
--- a/scripts/template.py
+++ b/scripts/template.py
@@ -214,12 +214,6 @@
self.options['summary'] = i18n.twtranslate(
site, 'template-changing', params)
- # regular expression to find the original template.
- # {{vfd}} does the same thing as {{Vfd}}, so both will be found.
- # The old syntax, {{msg:vfd}}, will also be found.
- # The group 'parameters' will either match the parameters, or an
- # empty string if there are none.
-
replacements = []
exceptions = {}
builder = textlib._MultiTemplateMatchBuilder(site)
--
To view, visit https://gerrit.wikimedia.org/r/282319
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I42135fff6b045f65cbcb629daca2b3827a345204
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: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #3390
Status: Errored
Duration: 2 hours, 33 minutes, and 9 seconds
Commit: ecfdf62 (master)
Author: amir
Message: Use custom_name for file namespace
Right now '%s' % FILE object returns ':File:' instead of 'File'
causing this script to behave really bad by changing [[File:Foo.jpg]]
to [[:File::Bar.jpg]]
Change-Id: I699dbcf5474a683871f20c2d548924ce7bdb137b
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/a24fbb91b54f...ecfdf62c…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/121452965
--
You can configure recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications