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.
--
To view, visit
https://gerrit.wikimedia.org/r/228645
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6624638c2003d2fe96f783ae7a15c7d61bc60197
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>