From 9ef27bc8f58e620ef72264de998a0035321155f0 Mon Sep 17 00:00:00 2001 From: reagle Date: Wed, 2 Feb 2011 17:14:26 -0500 Subject: [PATCH] trying merge --- src/mw/clicommands.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mw/clicommands.py b/src/mw/clicommands.py index b677004..2681c43 100644 --- a/src/mw/clicommands.py +++ b/src/mw/clicommands.py @@ -186,7 +186,7 @@ class PullCommand(CommandBase): for pageid in response.keys(): pagename = response[pageid]['title'] - # is the revisions list a sorted one, should I use [0] or [-1]? + # XXX is the revisions list a sorted one, should I use [0] or [-1]? last_wiki_rev_comment = response[pageid]['revisions'][0]['comment'] last_wiki_rev_user = response[pageid]['revisions'][0]['user'] @@ -319,6 +319,11 @@ class CommitCommand(CommandBase): if self.options.bot: data['bot'] = 'bot' response = self.api.call(data) + if 'error' in response: + if 'code' in response['error']: + if response['error']['code'] == 'permissiondenied': + print 'Permission denied -- try running "mw login"' + return if response['edit']['result'] == 'Success': if 'nochange' in response['edit']: print 'warning: no changes detected in %s - ' \ -- 2.30.2