Russell Blau has submitted this change and it was merged.
Change subject: Add Page.protection() method to core
......................................................................
Add Page.protection() method to core
This is similar to compat but returns a clearer dictionary from
corresponding site method.
Change-Id: I2427d5a9a62f38a4e64dfbf54577c57e2e8a07cc
---
M pywikibot/page.py
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Russell Blau: Verified; Looks good to me, approved
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 25e9046..76309f1 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -745,6 +745,10 @@
content=content
)
+ def protection(self):
+ """Returns a dictionary reflecting page
protections"""
+ return self.site.page_restrictions(self)
+
def canBeEdited(self):
"""Return bool indicating whether this page can be edited.
--
To view, visit
https://gerrit.wikimedia.org/r/131676
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2427d5a9a62f38a4e64dfbf54577c57e2e8a07cc
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Pyfisch <pyfisch(a)gmail.com>
Gerrit-Reviewer: Ricordisamoa <ricordisamoa(a)live.it>
Gerrit-Reviewer: Russell Blau <russblau(a)imapmail.org>
Gerrit-Reviewer: jenkins-bot <>