Scrapy, a fast high-level web crawling & scraping framework for Python.
moved spider loading below command line option processing, so options overrided by --set argument are taken into account at spider module-level code
Pablo Hoffmancbe8f8ff4532
diff --git a/scrapy/trunk/scrapy/command/cmdline.py b/scrapy/trunk/scrapy/command/cmdline.pyindex 0ef238448..4387a5694 100644--- a/scrapy/trunk/scrapy/command/cmdline.py+++ b/scrapy/trunk/scrapy/command/cmdline.py@@ -99,7 +99,6 @@ def execute():execute_with_args(sys.argv)def execute_with_args(argv):- spiders.load()cmds = builtin_commands_dict()cmds.update(custom_commands_dict())@@ -109,7 +108,7 @@ def execute_with_args(argv):if not cmdname:print "Scrapy %s\n" % scrapy.__version__print usage(argv)- sys.exit()+ sys.exit(2)parser = optparse.OptionParser()@@ -134,6 +133,7 @@ def execute_with_args(argv):command_executed['opts'] = opts.__dict__.copy()cmd.process_options(args, opts)+ spiders.load()log.start() # start loggingif opts.profile:log.msg("Profiling enabled. Analyze later with: python -m pstats %s" % opts.profile)