Skip to content

Commit

Permalink
Add launcher class to config
Browse files Browse the repository at this point in the history
  • Loading branch information
tonal committed Jun 19, 2012
1 parent 2768900 commit 3bddedf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scrapyd/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
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
Expand All @@ -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))
Expand Down
1 change: 1 addition & 0 deletions scrapyd/default_scrapyd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ http_port = 6800
debug = off
runner = scrapyd.runner
application = scrapyd.app.application
launcher = scrapyd.launcher.Launcher

0 comments on commit 3bddedf

Please sign in to comment.