jenkins-bot has submitted this change and it was merged.
Change subject: [COMPAT] Add Page.getRestrictions() from compat ......................................................................
[COMPAT] Add Page.getRestrictions() from compat
getRestictions() was added to compat in 2008. Add it to core for compatibility purpose and mark it as deprecated.
Change-Id: I6624638c2003d2fe96f783ae7a15c7d61bc60197 --- M pywikibot/page.py 1 file changed, 6 insertions(+), 0 deletions(-)
Approvals: XZise: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index 278ed54..e82c183 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -1965,6 +1965,12 @@ """ return self.title(asUrl=True)
+ @deprecated('Page.protection()') + def getRestrictions(self): + """DEPRECATED. Use self.protection() instead.""" + restrictions = self.protection() + return dict((k, list(restrictions[k])) for k in restrictions) + # ###### DISABLED METHODS (warnings provided) ###### # these methods are easily replaced by editing the page's text using # textlib methods and then using put() on the result.
pywikibot-commits@lists.wikimedia.org