mirror of https://github.com/scrapy/scrapy.git
Merge pull request #148 from tonal/cfg-launcher
Add launcher class to config
This commit is contained in:
commit
4eeda53b0d
|
|
@ -3,6 +3,8 @@ from twisted.application.internet import TimerService, TCPServer
|
|||
from twisted.web import server
|
||||
from twisted.python import log
|
||||
|
||||
from scrapy.utils.misc import load_object
|
||||
|
||||
from .interfaces import IEggStorage, IPoller, ISpiderScheduler, IEnvironment
|
||||
from .launcher import Launcher
|
||||
from .eggstorage import FilesystemEggStorage
|
||||
|
|
@ -27,7 +29,10 @@ def application(config):
|
|||
app.setComponent(ISpiderScheduler, scheduler)
|
||||
app.setComponent(IEnvironment, environment)
|
||||
|
||||
launcher = Launcher(config, app)
|
||||
laupath = config.get('launcher', 'scrapyd.launcher.Launcher')
|
||||
laucls = load_object(laupath)
|
||||
launcher = laucls(config, app)
|
||||
|
||||
timer = TimerService(5, poller.poll)
|
||||
webservice = TCPServer(http_port, server.Site(Root(config, app)), interface=bind_address)
|
||||
log.msg("Scrapyd web console available at http://%s:%s/" % (bind_address, http_port))
|
||||
|
|
|
|||
|
|
@ -11,3 +11,4 @@ http_port = 6800
|
|||
debug = off
|
||||
runner = scrapyd.runner
|
||||
application = scrapyd.app.application
|
||||
launcher = scrapyd.launcher.Launcher
|
||||
|
|
|
|||
Loading…
Reference in New Issue