- avoid to raise an exception when no arg is given to replay command

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40183
This commit is contained in:
olveyra 2008-08-27 17:21:12 +00:00
parent b11b84fff1
commit 9164150bed
1 changed files with 9 additions and 8 deletions

View File

@ -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: