jenkins-bot has submitted this change and it was merged.
Change subject: Add revid to Notification object
......................................................................
Add revid to Notification object
Since most edit-related notifications include revid attributes,
we should include the revids in the Notification objects as we're
building them (if they exist).
Change-Id: Ifdb98e7c79729a1c2f7a5c4c4366e28071a48239
---
M pywikibot/echo.py
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/echo.py b/pywikibot/echo.py
index f9fa001..6d6587b 100644
--- a/pywikibot/echo.py
+++ b/pywikibot/echo.py
@@ -43,6 +43,7 @@
notif.read = False
notif.content = data.get('*', None)
+ notif.revid = data.get('revid', None)
return notif
--
To view, visit https://gerrit.wikimedia.org/r/297118
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifdb98e7c79729a1c2f7a5c4c4366e28071a48239
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: APerson <danielhglus(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Fix notifications building from JSON
......................................................................
Fix notifications building from JSON
Sometimes (like in welcome messages), notifications don't have a
'title' property, so we shouldn't assume there is one.
Bug: T139015
Change-Id: I83e480d04e8e09aa9bcb5edef4f56b47d150e199
---
M pywikibot/echo.py
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/echo.py b/pywikibot/echo.py
index 8c9584a..f9fa001 100644
--- a/pywikibot/echo.py
+++ b/pywikibot/echo.py
@@ -27,8 +27,10 @@
notif.category = data['category']
notif.timestamp = pywikibot.Timestamp.fromtimestampformat(data['timestamp']['mw'])
- # TODO: use 'namespace-key' + 'text' ?
- notif.page = pywikibot.Page(site, data['title']['full'])
+ if 'title' in data and 'full' in data['title']:
+ notif.page = pywikibot.Page(site, data['title']['full'])
+ else:
+ notif.page = None
if 'agent' in data and 'name' in data['agent']:
notif.agent = pywikibot.User(site, data['agent']['name'])
--
To view, visit https://gerrit.wikimedia.org/r/296688
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I83e480d04e8e09aa9bcb5edef4f56b47d150e199
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: APerson <danielhglus(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>