From: Ian Weller Date: Mon, 7 Dec 2009 07:00:26 +0000 (-0500) Subject: Handle slashes in page names semi-appropriately X-Git-Url: https://projects.mako.cc/source/mw/commitdiff_plain/9c4137b12a124122a44c905ab82272f48d128d63?ds=sidebyside Handle slashes in page names semi-appropriately --- diff --git a/src/mw/clicommands.py b/src/mw/clicommands.py index 3657d53..7726703 100644 --- a/src/mw/clicommands.py +++ b/src/mw/clicommands.py @@ -97,7 +97,8 @@ class FetchCommand(CommandBase): response[pageid]['title'], revid) self.metadir.add_rv_info(response[pageid]['revisions'][0]) - fd = file(os.path.join(self.metadir.root, \ - response[pageid]['title'].replace(' ', '_') + \ - '.wiki'), 'w') + filename = response[pageid]['title'].replace(' ', '_') + filename = filename.replace('/', '!') + fd = file(os.path.join(self.metadir.root, filename + '.wiki'), + 'w') fd.write(response[pageid]['revisions'][0]['*'].encode('utf-8'))