1641
by Canonical.com Patch Queue Manager
move trebuchet into launchpad |
1 |
# Twisted Application Configuration file.
|
2 |
# Use with "twistd -y <file.tac>", e.g. "twistd -noy server.tac"
|
|
3 |
||
4 |
from twisted.application import service, internet |
|
5 |
from twisted.web import server |
|
6 |
||
7 |
from canonical.launchpad.daemons.trebuchet import TrebuchetServer |
|
1948
by Canonical.com Patch Queue Manager
[r=stub] Bring trebuchet into the production/staging/development frameworks similar to Librarian |
8 |
from canonical.lp import initZopeless |
9 |
from canonical.config import config |
|
10 |
||
11 |
||
12 |
# Connect to database
|
|
13 |
# (hctapi will pick this up automatically)
|
|
14 |
initZopeless(dbuser=config.trebuchet.dbuser, implicitBegin=False) |
|
1641
by Canonical.com Patch Queue Manager
move trebuchet into launchpad |
15 |
|
16 |
# Construct the application
|
|
17 |
application = service.Application("trebuchet") |
|
18 |
||
19 |
# Construct the server
|
|
20 |
treb = TrebuchetServer() |
|
21 |
||
22 |
# Create the server and tie the service to the application
|
|
1948
by Canonical.com Patch Queue Manager
[r=stub] Bring trebuchet into the production/staging/development frameworks similar to Librarian |
23 |
tcpPort = int(config.trebuchet.port) |
24 |
internet.TCPServer(tcpPort, server.Site(treb)).setServiceParent(application) |