From: Ian Weller Date: Wed, 2 Feb 2011 20:55:02 +0000 (-0600) Subject: Add logout function, reset high limits on auth X-Git-Url: https://projects.mako.cc/source/python-simplemediawiki.debian/commitdiff_plain/ff07783351f6cb4f7a129e5e7cce8aeafe3084d4?hp=c2c978f25fc626681c7d8ba477bea9082ae8ce93 Add logout function, reset high limits on auth --- diff --git a/simplemediawiki.py b/simplemediawiki.py index 940fb2b..05dd471 100644 --- a/simplemediawiki.py +++ b/simplemediawiki.py @@ -138,12 +138,22 @@ class MediaWiki(): data['lgtoken'] = token result = self.call(data) if result['login']['result'] == 'Success': + self._high_limits = None return True elif result['login']['result'] == 'NeedToken' and not token: return self.login(user, passwd, result['login']['token']) else: return False + def logout(self): + """ + Conveinence function for logging out of the wiki. + """ + data = {'action': 'logout'} + self.call(data) + self._high_limits = None + return True + def limits(self, low, high): """ Convenience function for determining appropriate limits in the API. If