]> projects.mako.cc - mw/commitdiff
fetch: Handle pages that do not exist
authorIan Weller <ian@ianweller.org>
Sat, 19 Dec 2009 05:45:55 +0000 (23:45 -0600)
committerIan Weller <ian@ianweller.org>
Sat, 19 Dec 2009 05:45:55 +0000 (23:45 -0600)
src/mw/clicommands.py

index 77267035bff5af89ffa7cb57f4c1da1a441cb2e5..b749dd841ecdafe13d4f71aa8f45470a9cd0363b 100644 (file)
@@ -92,6 +92,10 @@ class FetchCommand(CommandBase):
             }
             response = self.api.call(data)['query']['pages']
             for pageid in response.keys():
+                if 'missing' in response[pageid].keys():
+                    print '%s: %s: page does not exist, file not created' % \
+                            (self.me, response[pageid]['title'])
+                    continue
                 revid = [x['revid'] for x in response[pageid]['revisions']]
                 self.metadir.add_page_info(int(pageid),
                                            response[pageid]['title'],

Benjamin Mako Hill || Want to submit a patch?