]> projects.mako.cc - mw/commitdiff
Handle slashes in page names semi-appropriately
authorIan Weller <ian@ianweller.org>
Mon, 7 Dec 2009 07:00:26 +0000 (02:00 -0500)
committerIan Weller <ian@ianweller.org>
Mon, 7 Dec 2009 07:00:26 +0000 (02:00 -0500)
src/mw/clicommands.py

index 3657d532ad18280d37db5bdd90878fede112ec77..77267035bff5af89ffa7cb57f4c1da1a441cb2e5 100644 (file)
@@ -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'))

Benjamin Mako Hill || Want to submit a patch?