jenkins-bot has submitted this change and it was merged.
Change subject: Doc: fix misc errors reported by Sphinx
......................................................................
Doc: fix misc errors reported by Sphinx
Also comment out Sphinx `_static` setting.
Change-Id: Ie90d88734f15995d82b3a0b029409bbc0a189fd8
---
M docs/conf.py
M pywikibot/config2.py
M pywikibot/i18n.py
M pywikibot/page.py
4 files changed, 19 insertions(+), 12 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/docs/conf.py b/docs/conf.py
index a7b4ec4..2e59f19 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -122,7 +122,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+# html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
diff --git a/pywikibot/config2.py b/pywikibot/config2.py
index 971b19d..559a9cf 100644
--- a/pywikibot/config2.py
+++ b/pywikibot/config2.py
@@ -16,14 +16,17 @@
Provides two functions to register family classes which can be used in
the user-config:
+
- register_family_file
- register_families_folder
Other functions made available to user-config:
+
- user_home_path
Sets module global base_dir and provides utility methods to
build paths relative to base_dir:
+
- makepath
- datafilepath
- shortpath
diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py
index 69549f8..b80f9ac 100644
--- a/pywikibot/i18n.py
+++ b/pywikibot/i18n.py
@@ -519,15 +519,21 @@
value. Multiple plurals are allowed.
As an examples, if we had several json dictionaries in test folder like:
- en.json:
- {
+
+ en.json:
+
+ {
"test-plural": "Bot: Changing %(num)s {{PLURAL:%(num)d|page|pages}}.",
- }
- fr.json
- {
+ }
+
+ fr.json:
+
+ {
"test-plural": "Robot: Changer %(descr)s {{PLURAL:num|une page|quelques pages}}.",
- }
- and so on.
+ }
+
+ and so on.
+
>>> from pywikibot import i18n
>>> i18n.set_messages_package('tests.i18n')
>>> # use a number
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 86290c7..c6b3f9b 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -1943,7 +1943,6 @@
@return: a generator that yields a tuple for each use of a template
in the page, with the template Page as the first entry and a list of
parameters as the second entry.
-
"""
# WARNING: may not return all templates used in particularly
# intricate cases such as template substitution
@@ -2436,12 +2435,11 @@
@param cat: New category title (without namespace) or Category object
@type cat: unicode or Category
@param message: message to use for category creation message
- If two %s are provided in message, will be replaced
- by (self.title, authorsList)
+ If two %s are provided in message, will be replaced
+ by (self.title, authorsList)
@type message: unicode
@return: True if copying was successful, False if target page
already existed.
-
"""
# This seems far too specialized to be in the top-level framework
# move to category.py? (Although it doesn't seem to be used there,
--
To view, visit https://gerrit.wikimedia.org/r/214842
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie90d88734f15995d82b3a0b029409bbc0a189fd8
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Hashar <hashar(a)free.fr>
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: Siebrand <siebrand(a)kitano.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #2302
Status: Passed
Duration: 21 minutes and 44 seconds
Commit: 0592360 (master)
Author: Ricordisamoa
Message: replace.py: fix handling of addedCat, again
In ReplaceRobot, with addedCat set, get categories from the new
wikitext, otherwise old categories might be added back.
Change-Id: Ie7c19d0517882e465183cc7982af7f3c5f733bf6
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/ae0847852efb...0592360e…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/64699217
--
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: replace.py: fix handling of addedCat, again
......................................................................
replace.py: fix handling of addedCat, again
In ReplaceRobot, with addedCat set, get categories from the new
wikitext, otherwise old categories might be added back.
Change-Id: Ie7c19d0517882e465183cc7982af7f3c5f733bf6
---
M scripts/replace.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/replace.py b/scripts/replace.py
index 2aa2d34..73c73aa 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -602,7 +602,7 @@
if hasattr(self, 'addedCat'):
# Fetch only categories in wikitext, otherwise the others will
# be explicitly added.
- cats = textlib.getCategoryLinks(original_text)
+ cats = textlib.getCategoryLinks(new_text)
if self.addedCat not in cats:
cats.append(self.addedCat)
new_text = textlib.replaceCategoryLinks(new_text,
--
To view, visit https://gerrit.wikimedia.org/r/214805
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie7c19d0517882e465183cc7982af7f3c5f733bf6
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ricordisamoa <ricordisamoa(a)openmailbox.org>
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: Mpaa <mpaa.wiki(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: Allow botirc module to load without irc dep
......................................................................
Allow botirc module to load without irc dep
This allows sphinx to load the module without installing
pre-req package 'irc'.
Change-Id: I8235ca9008da07daeb65e1dae7424c2a8068a21e
---
M pywikibot/botirc.py
1 file changed, 12 insertions(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/botirc.py b/pywikibot/botirc.py
index c63f4d0..2464d8a 100644
--- a/pywikibot/botirc.py
+++ b/pywikibot/botirc.py
@@ -7,7 +7,7 @@
"""
#
# (C) Balasyum, 2008
-# (C) Pywikibot team, 2008-2014
+# (C) Pywikibot team, 2008-2015
#
# Distributed under the terms of the MIT license.
#
@@ -22,7 +22,17 @@
import re
-from ircbot import SingleServerIRCBot
+try:
+ from ircbot import SingleServerIRCBot
+except ImportError as e:
+ class SingleServerIRCBot(object):
+
+ """Fake SingleServerIRCBot."""
+
+ def __init__(*args, **kwargs):
+ """Report import exception."""
+ raise e
+
_logger = "botirc"
--
To view, visit https://gerrit.wikimedia.org/r/214017
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8235ca9008da07daeb65e1dae7424c2a8068a21e
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: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: replace.py: fix handling of addedCat
......................................................................
replace.py: fix handling of addedCat
In ReplaceRobot, with addedCat set, get categories from wikitext
instead of API, otherwise all categories will be then added.
Change-Id: Ie68e148d50ac057f8919277606e05c99ffacc609
---
M scripts/replace.py
1 file changed, 11 insertions(+), 5 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/replace.py b/scripts/replace.py
index b815609..2aa2d34 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -425,6 +425,7 @@
replaced.
* addedCat - If set to a value, add this category to every page
touched.
+ It can be a string or a Category object.
Structure of the exceptions dictionary:
This dictionary can have these keys:
@@ -462,10 +463,13 @@
self.recursive = recursive
if site:
self.site = site
+
if addedCat:
- cat_ns = site.category_namespaces()[0]
- self.addedCat = pywikibot.Page(self.site,
- cat_ns + ':' + addedCat)
+ if isinstance(addedCat, pywikibot.Category):
+ self.addedCat = addedCat
+ else:
+ self.addedCat = pywikibot.Category(self.site, addedCat)
+
self.sleep = sleep
self.summary = summary
self.changed_pages = 0
@@ -595,8 +599,10 @@
pywikibot.output(u'No changes were necessary in %s'
% page.title(asLink=True))
break
- if hasattr(self, "addedCat"):
- cats = page.categories(nofollow_redirects=True)
+ if hasattr(self, 'addedCat'):
+ # Fetch only categories in wikitext, otherwise the others will
+ # be explicitly added.
+ cats = textlib.getCategoryLinks(original_text)
if self.addedCat not in cats:
cats.append(self.addedCat)
new_text = textlib.replaceCategoryLinks(new_text,
--
To view, visit https://gerrit.wikimedia.org/r/214647
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie68e148d50ac057f8919277606e05c99ffacc609
Gerrit-PatchSet: 1
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: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>