jenkins-bot merged this change.

View Change

Approvals: Framawiki: Looks good to me, approved jenkins-bot: Verified
[bugfix] re-enable notifications

- "text" value for notformat parameter is no longer available and there is
not hint when this was dropped. Use 'special' instead.
- "format" keyword may also be None which does not return the content values.
- "prop" parameter is "list" by default.

Bug: T205184
Change-Id: Id05ee852b6f8ce0ad5aeb842f9d5a1f8e033b7e3
---
M pywikibot/site.py
1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/pywikibot/site.py b/pywikibot/site.py
index c4a97e5..dea582c 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -2321,16 +2321,23 @@

@need_extension('Echo')
def notifications(self, **kwargs):
- """Yield Notification objects from the Echo extension."""
+ """Yield Notification objects from the Echo extension.
+
+ keyword format: If specified, notifications will be returned formatted
+ this way. Its value is either 'model', 'special' or None. Default
+ is 'special'.
+ type format: str or None
+
+ Refer API reference for other keywords.
+ """
params = {
'action': 'query',
'meta': 'notifications',
- 'notprop': 'list',
- 'notformat': 'text',
+ 'notformat': 'special',
}

- for key in kwargs:
- params['not' + key] = kwargs[key]
+ for key, value in kwargs.items():
+ params['not' + key] = value

data = self._simple_request(**params).submit()
notifications = data['query']['notifications']['list']

To view, visit change 462128. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id05ee852b6f8ce0ad5aeb842f9d5a1f8e033b7e3
Gerrit-Change-Number: 462128
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Framawiki <framawiki@tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)