From 9164150bed4b40b2aa15fd50c5666bbf1f2f3f68 Mon Sep 17 00:00:00 2001 From: olveyra Date: Wed, 27 Aug 2008 17:21:12 +0000 Subject: [PATCH] - avoid to raise an exception when no arg is given to replay command --HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40183 --- scrapy/trunk/scrapy/command/commands/replay.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scrapy/trunk/scrapy/command/commands/replay.py b/scrapy/trunk/scrapy/command/commands/replay.py index a0be811b5..4c0a3fd79 100644 --- a/scrapy/trunk/scrapy/command/commands/replay.py +++ b/scrapy/trunk/scrapy/command/commands/replay.py @@ -36,14 +36,15 @@ class Command(ScrapyCommand): parser.add_option("--pages", dest="pages", action="store_true", help="update all the pages in the replay file, recording it again.") def process_options(self, args, opts): - ScrapyCommand.process_options(self, args, opts) - self.opts = opts - self.action = args[1] if len(args) > 1 else 'crawl' - mode = 'update' if self.action == 'update' else 'play' - usedir = args and os.path.isdir(args[0]) - self.replay = Replay(args[0], mode=mode, usedir=usedir) - if self.action not in ['crawl', 'diff', 'update']: - settings.overrides['LOG_ENABLED'] = False + if args: + ScrapyCommand.process_options(self, args, opts) + self.opts = opts + self.action = args[1] if len(args) > 1 else 'crawl' + mode = 'update' if self.action == 'update' else 'play' + usedir = args and os.path.isdir(args[0]) + self.replay = Replay(args[0], mode=mode, usedir=usedir) + if self.action not in ['crawl', 'diff', 'update']: + settings.overrides['LOG_ENABLED'] = False def run(self, args, opts): if not args: