jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/497837 )
Change subject: Added my name in credits file.
......................................................................
Added my name in credits file.
As asked by a reviewer on other patch
Change-Id: I4e3b7d9aca481bb90777fc143f93d31c9e9940a4
---
M CREDITS
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/CREDITS b/CREDITS
index 02a2706..f6afe6a 100644
--- a/CREDITS
+++ b/CREDITS
@@ -119,6 +119,7 @@
MuhammadShuaib
Nicolas Dumazet
Nikhil Prakash
+Nikitrain
Nikiwiki
notconfusing
Nullzero
--
To view, visit https://gerrit.wikimedia.org/r/497837
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4e3b7d9aca481bb90777fc143f93d31c9e9940a4
Gerrit-Change-Number: 497837
Gerrit-PatchSet: 1
Gerrit-Owner: Nikitrain <nikitarajput360(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Nikitrain <nikitarajput360(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/497804 )
Change subject: Improve docstrings to the Pywikibot library
......................................................................
Improve docstrings to the Pywikibot library
Modified docstrings of logenties by adding epytext fields.
Bug: T118423
Change-Id: Ia6dbbb62f1910a86a6a731ce2d6bf183c44d3d0d
---
M pywikibot/logentries.py
1 file changed, 17 insertions(+), 4 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/logentries.py b/pywikibot/logentries.py
index b757645..1248334 100644
--- a/pywikibot/logentries.py
+++ b/pywikibot/logentries.py
@@ -223,7 +223,8 @@
It raises an Error if the entry is an unblocking log entry.
- @rtype: list of flag strings
+ @return: list of flags strings
+ @rtype: list
"""
if self.action() == 'unblock':
return []
@@ -340,7 +341,11 @@
@property
def target_page(self):
- """Return target page object."""
+ """
+ Return target page object.
+
+ @rtype: pywikibot.Page
+ """
if not hasattr(self, '_target_page'):
self._target_page = pywikibot.Page(self.site, self.target_title)
return self._target_page
@@ -363,7 +368,11 @@
@property
def current_id(self):
- """Return the current id."""
+ """
+ Return the current id.
+
+ @rtype: int
+ """
# key has been changed in mw 1.19; try the new mw style first
# sometimes it returns strs sometimes ints
return int(self._params['curid']
@@ -371,7 +380,11 @@
@property
def previous_id(self):
- """Return the previous id."""
+ """
+ Return the previous id.
+
+ @rtype: int
+ """
# key has been changed in mw 1.19; try the new mw style first
# sometimes it returns strs sometimes ints
return int(self._params['previd']
--
To view, visit https://gerrit.wikimedia.org/r/497804
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia6dbbb62f1910a86a6a731ce2d6bf183c44d3d0d
Gerrit-Change-Number: 497804
Gerrit-PatchSet: 1
Gerrit-Owner: Nikitrain <nikitarajput360(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Nikitrain <nikitarajput360(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/497519 )
Change subject: [bugfix] Set optional parameter namespace to None in site.logpages
......................................................................
[bugfix] Set optional parameter namespace to None in site.logpages
- Deprecated site method logpages calls logevents.
The namespace parameter is suppressed when it is None and not submitted
to the api. An empty list is not None therefore the parameter is passed
to the API and this will cause a warning thrown be api,set_namespace for
older mediawiki version which doesnot support this parameter with
logevents.
- Wikia has mw 1.19.24 currently and has no namespace support for logevents
but it is not clear when this was introduced.
- Skip site_tests.TestLogPages.test_list_namespace for mw <= 1.19.24
- The other failing methods of T217664 are solved with the new default
value of the optional parameter above.
Bug: T217664
Change-Id: I11f4746461dce3ca1810b036ec74104809d52f10
---
M pywikibot/site.py
M tests/site_tests.py
2 files changed, 5 insertions(+), 1 deletion(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 26c11c4..99af4e7 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -4678,7 +4678,7 @@
@deprecated('APISite.logevents()', since='20141225')
@deprecated_args(repeat=None)
def logpages(self, number=50, mode=None, title=None, user=None,
- namespace=[], start=None, end=None, tag=None, newer=False,
+ namespace=None, start=None, end=None, tag=None, newer=False,
dump=False, offset=None):
"""
Iterate log pages. DEPRECATED.
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 5c9069c..c007217 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -1358,6 +1358,10 @@
def test_list_namespace(self):
"""Test the deprecated site.logpages() when namespace is a list."""
+ if self.site.mw_version <= '1.19.24': # T217664
+ self.skipTest(
+ 'logevents does not support namespace parameter with MediaWiki'
+ ' {}.'.format(self.site.mw_version))
le = list(self.site.logpages(namespace=[2, 3], number=10))
for entry in le:
if isinstance(entry[0], int): # autoblock removal entry
--
To view, visit https://gerrit.wikimedia.org/r/497519
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I11f4746461dce3ca1810b036ec74104809d52f10
Gerrit-Change-Number: 497519
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Addshore <addshorewiki(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/497476 )
Change subject: [doc] Print a more explainable error messages
......................................................................
[doc] Print a more explainable error messages
Bug: T217948
Change-Id: I6d9248ae91005a6842bdba07169c344a49f63005
---
M pywikibot/i18n.py
1 file changed, 7 insertions(+), 6 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py
index d2de223..4000a51 100644
--- a/pywikibot/i18n.py
+++ b/pywikibot/i18n.py
@@ -33,6 +33,7 @@
from collections.abc import Mapping
except ImportError: # Python 2.7
from collections import Mapping
+from textwrap import fill
from warnings import warn
import pywikibot
@@ -749,12 +750,12 @@
if trans:
break
else:
- raise TranslationError(
- 'No %s translation has been defined for TranslateWiki key %r\n'
- 'It can happen due to lack of i18n submodule or files. See '
- '%s/i18n'
- % ('English' if 'en' in langs else "'%s'" % lang,
- twtitle, __url__))
+ raise TranslationError(fill(
+ 'No {} translation has been defined for TranslateWiki key "{}". '
+ 'It can happen due to lack of i18n submodule or files or an '
+ 'outdated submodule. See {}/i18n'
+ .format('English' if 'en' in langs else "'{}'".format(lang),
+ twtitle, __url__)))
# send the language code back via the given mutable list parameter
if source_needed:
source.append(alt)
--
To view, visit https://gerrit.wikimedia.org/r/497476
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6d9248ae91005a6842bdba07169c344a49f63005
Gerrit-Change-Number: 497476
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: JAn Dudík <jan.dudik(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Siebrand <siebrand(a)kitano.nl>
Gerrit-Reviewer: jenkins-bot (75)