From cb2e8527af434daeeb20e4c796df43b7cff2b1a9 Mon Sep 17 00:00:00 2001 From: Joseph Reagle Date: Tue, 8 Feb 2011 11:12:10 -0500 Subject: [PATCH] pull must handle deleted pages --- src/mw/clicommands.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mw/clicommands.py b/src/mw/clicommands.py index aec3f24..433e607 100644 --- a/src/mw/clicommands.py +++ b/src/mw/clicommands.py @@ -187,6 +187,11 @@ class PullCommand(CommandBase): for pageid in response.keys(): pagename = response[pageid]['title'] + # If no revisions, then error, perhaps page deleted + if 'revisions' not in response[pageid]: + print 'skipping: "%s" -- cannot find page, perhaps deleted' % (pagename) + continue + # Is the revisions list a sorted one, should I use [0] or [-1]? -- reagle if 'comment' in response[pageid]['revisions'][0]: last_wiki_rev_comment = response[pageid]['revisions'][0]['comment'] -- 2.39.5