X-Git-Url: https://projects.mako.cc/source/mw/blobdiff_plain/fb328c2757462c9a7ea8ee85075b5c1b68e5d396..3ec21f92ccc70c2283d15506dc0384e5442deee2:/src/mw/clicommands.py diff --git a/src/mw/clicommands.py b/src/mw/clicommands.py index 7714893..7726703 100644 --- a/src/mw/clicommands.py +++ b/src/mw/clicommands.py @@ -38,6 +38,7 @@ class CommandBase(object): dest='use_auth', help='force authentication ' 'even if not required') self.parser.add_option_group(global_options) + self.shortcuts = [] def main(self): (self.options, self.args) = self.parser.parse_args() @@ -75,6 +76,7 @@ class FetchCommand(CommandBase): def __init__(self): usage = '%prog fetch [options] PAGENAME ...' CommandBase.__init__(self, 'fetch', 'fetch remote pages', usage) + self.shortcuts.append('ft') def _do_command(self): self._die_if_no_init() @@ -95,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'))