Commit Graph

36 Commits

Author SHA1 Message Date
Mikhail Korobov ff235fa19a Remove --lsprof command-line option. Fixes GH-1531 2016-01-19 00:00:31 +05:00
nyov 3e6d6c43ac PY3 fix test cmdline 2015-08-08 04:19:55 +05:00
Julia Medina 616aec92c8 Move scrapy/command.py to scrapy/commands/__init__.py 2015-05-09 03:20:36 -03:00
Felix Yan 4f24e724a3 PY3: use six.iterkeys, six.iteritems, and tempfile 2014-07-14 18:47:22 +08:00
Julia Medina 080a28f3e9 Change command's default_settings population in cmdline.py 2014-06-10 11:26:50 -03:00
alexanderlukanin13 ae4a61a2d5 Added "from __future__ import print_function" in all relevant places except xlib 2013-10-20 11:55:07 +06:00
alexanderlukanin13 d381a35732 Python 3 compatible syntax: print, except, raise, octal numbers; removed Python 2.2 boolean compatibility code in xlib/pydispatch/dispatcher.py 2013-10-20 01:59:35 +06:00
Alex Cepoi a9a911fb09 default to multi crawler commands
compatibility for old single crawler process
deprecated command's `crawler` property
logs about settings only shown once
2013-08-19 22:43:29 +02:00
Alex Cepoi 919d7c4062 command with multiple crawlers, fix check command 2013-07-08 17:00:43 +02:00
Jordi Llonch d9261f6c54 pluggable sub-commands for scrapy comand-line 2013-03-06 05:25:38 +11:00
Pablo Hoffman e8e5a62c20 better backwards compatibility for scrapy.conf.settings
Althought this backwards compatibility is more complex, it avoid modules
from failing when importing scrapy.conf, if they are not run through
"scrapy" command (such as when running tests on scrapy projects code).
2012-10-25 11:41:40 -02:00
Pablo Hoffman a0e2b6e3ff simplified backwards compatibility of scrapy.conf 2012-10-12 17:28:02 -02:00
Pablo Hoffman 7afedb89e9 backwards compatibility support for scrapy.conf.settings singleton for when scrapy.conf is imported *before* calling scrapy.cmdline.execute(), such as in custom bot runners 2012-09-19 12:44:59 -03:00
Pablo Hoffman c7f8219901 - removed scrapy.conf singleton from scrapy.log, scrapy.responsetypes,
scrapy.http.response.text, scrapy.selector
- fixed bug with scrapy.conf.settings backwards compatibility support
- added facility to notify (and provide some guidelines) about deprecated/obsolete settings
2012-09-19 03:03:34 -03:00
Pablo Hoffman cd823018aa removed another instance of scrapy.conf.settings singleton, this time from scrapy.cmdline (which manages scrapy command line tool), by moving the get_project_settings() function to scrapy.utils.project 2012-09-16 20:53:52 -03:00
Pablo Hoffman 1e521a3ff3 improved command line tool usage help which explains that more commands are available when run from project directory. refs #107 2012-04-19 02:54:57 -03:00
Pablo Hoffman 9fddc73ed8 removed backwards compatibility code for old scrapy versions 2012-03-06 05:42:09 -02:00
Pablo Hoffman e521da2e2f Dropped support for Python 2.5. See: http://blog.scrapy.org/scrapy-dropping-support-for-python-25 2012-03-01 08:18:12 -02:00
Pablo Hoffman d788ba8a44 new mechanism to override settings in scrapy commands before the Crawler object is available 2011-09-15 13:27:01 -03:00
Pablo Hoffman 0eaa1d95f6 replaced DeprecationWarning by a new ScrapyDeprecationWarning category, since the default DeprecationWarning is silenced on Python 2.7+ 2011-08-08 10:39:53 -03:00
Pablo Hoffman 048044c1f8 A couple of changes to fix #303:
* improved detection of inside-project environments
* make list command faster (by only instantiating the spider manger)
* print a warning when extensions (middlewares, etc) are disabled with a message on NotConfigured exception
* assert that scrapy configuration hasn't been loaded in scrapyd.runner
* simplified IgnoreRequest exception, to avoid loading settings when importing scrapy.exceptions
* added test to make sure certain modules don't cause scrapy.conf module to be
  loaded, to ensure the scrapyd runner bootstraping performs properly
2011-01-05 15:59:43 -02:00
Pablo Hoffman a5ee05e814 Added support for setting exit code in Scrapy commands. Closes #248 2010-09-23 13:43:21 -03:00
Pablo Hoffman f29b346f79 Fixed access to settings module name, broken after recent changes to Settings classes 2010-09-22 22:21:29 -03:00
Pablo Hoffman b11e11037f Make custom project commands discovery work with eggified projects. Fixes #247 2010-09-22 15:42:31 -03:00
Pablo Hoffman 37776618a3 Changed format of scrapy.cfg file to contain a [settings] section and a 'default' key inside it, instead of the other way around 2010-09-02 21:22:17 -03:00
Pablo Hoffman 59f09c50e4 Yet another scrapy.cmdline code refactoring by removing --settings and --version options, adding a version command and adding a UsageError exception for signaling usage errors. Updated all commands accordingly 2010-08-28 18:06:51 -03:00
Pablo Hoffman 8fc78c4d0a Refactoring of Crawler, Commands, Execution Queue and Spider Manager:
Commands changes:

* removed (somewhat hacky) --init argument from settings command
* added set_crawler method to Commands, and a ``crawler`` property that returns
  a configured crawler. This way, commands that don't require a crawler (such
  as startproject) won't need to configure one.

Execution Queue changes:

* changed SERVICE_QUEUE_FILE setting to SQLITE_DB
* removed SERVICE_QUEUE setting
* added QUEUE_CLASS setting for defining the class to use for the execution queue
* added SERVER_QUEUE_CLASS setting for defining the class to use for the
  execution queue in server mode (runserver command)

Spider Manager changes:

* simplified SpiderManager API by removing the load() method
* added from_settings classmethod to SpiderManager
* added spider_modules constructor argument to SpiderManager

Crawler changes:

* added install() method to Crawler (to install it in scrapy.project) and
  uninstall() to remove it
* use CrawlerProcess.install() in scrapy.cmdline
* use crawler.install() and crawler.uninstall() in tests that a crawler in
  scrapy.project
* make telnet console and webservice play nicer with twisted by stopping
  listening when then engine goes down
* refactored Scrapy engine tests - it no longer uses the crawler singleton.
  Closes #215.
2010-08-25 19:24:36 -03:00
Pablo Hoffman 8d24175c81 Added CrawlerProcess class, isolating all (Twisted) reactor-controlling code
into this class and leaving the Crawler class free of any reactor control.

This allows embedding the Scrapy crawler in other Twisted applications, or any
Twisted asynchronous code.

The "scrapy" command will use the new CrawlerProcess class, which resembles the
behaviour of the old (all-in-one) Crawler class.

Closes #214.

Also moved log.start() call from Crawler class to scrapy.cmdline module.
2010-08-25 05:24:02 -03:00
Pablo Hoffman faf7a7da83 Moved scrapymanager singleton to scrapy.project module. Refs #189
Detail of changes:

* Moved scrapy.core.manager.ExecutionManager class to scrapy.crawler.Crawler
* Added scrapy.project.crawler singleton to reference a singleton instance of
  Crawler class (previously known as scrapymanager)
* Left an alias scrapy.core.manager.scrapymanager to scrapy.project.crawler for
  backwards compatibility (to be removed in Scrapy 0.11)
2010-08-22 02:10:53 -03:00
Pablo Hoffman 0da6132136 Made command-line too output more concise 2010-08-21 03:37:59 -03:00
Pablo Hoffman 66525e77c7 Improved support for scrapy-ctl -> scrapy migration by generating the scrapy.cfg file automatically if it doensn't exist 2010-08-19 17:57:34 -03:00
Pablo Hoffman 34554da201 Deprecated scrapy-ctl.py command in favour of simpler "scrapy" command. Closes #199. Also updated documenation accordingly and added convenient scrapy.bat script for running from Windows.
--HG--
rename : debian/scrapy-ctl.1 => debian/scrapy.1
rename : docs/topics/scrapy-ctl.rst => docs/topics/cmdline.rst
2010-08-18 19:48:32 -03:00
Pablo Hoffman 50f2236d04 removed hacky command_executed signal 2010-08-17 18:31:16 -03:00
Pablo Hoffman a71521bfba Default per-command settings are now specified in the default_settings attribute of the command object. Closes #201 2010-08-17 18:30:13 -03:00
Pablo Hoffman 2905a2083b moved scrapy.command.models module to scrapy.command 2010-05-26 10:29:32 -03:00
Pablo Hoffman 14bfeabede moved scrapy.command.cmdline module to scrapy.cmdline (keeping backwards compatibility until 0.10)
--HG--
rename : scrapy/command/cmdline.py => scrapy/cmdline.py
2010-05-26 10:29:32 -03:00