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.
pywikibot-commits@lists.wikimedia.org