~launchpad-pqm/launchpad/devel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Copyright 2009 Canonical Ltd.  This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).

# Twisted Application Configuration file.
# Use with "twistd -y <file.tac>", e.g. "twistd -noy server.tac"

from twisted.application import service

from canonical.buildd.sequencer import BuildSequencer

# Construct the application
application = service.Application("BuildSequencer")

class BuildSequencerService(service.Service):
    def __init__(self, buildSequencer):
        self.buildSequencer = buildSequencer
 
    def startService(self):
        # Kick everything off...
        self.buildSequencer.scheduleCallback()
 

# Construct the sequencer. It will automatically schedule the first job.
bseq = BuildSequencer()
# Make a service out of the sequencer
bserv = BuildSequencerService(bseq)

# Activate the service
BuildSequencerService(bseq).setServiceParent(application)

# Falling off the end here passes into twisted's reactor.