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 <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Pyfisch <[email protected]>
Gerrit-Reviewer: Ricordisamoa <[email protected]>
Gerrit-Reviewer: Russell Blau <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits