From ff07783351f6cb4f7a129e5e7cce8aeafe3084d4 Mon Sep 17 00:00:00 2001 From: Ian Weller Date: Wed, 2 Feb 2011 14:55:02 -0600 Subject: [PATCH] Add logout function, reset high limits on auth --- simplemediawiki.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- 2.39.5