~launchpad-pqm/launchpad/devel

3944.1.1 by Francis J. Lacoste
Use system version python2.4 for scripts.
1
#! /usr/bin/python2.4
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
2
##############################################################################
3
#
4
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
5
# All Rights Reserved.
6
#
7
# This software is subject to the provisions of the Zope Public License,
8
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
9
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
10
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
11
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
12
# FOR A PARTICULAR PURPOSE.
13
#
14
##############################################################################
1628 by Canonical.com Patch Queue Manager
Configuration, Librian and Librarian test harness work
15
"""Start script for Launchpad: loads configuration and starts the server.
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
16
4004.3.15 by Jonathan Lange
Move module docstring to script. Make TWISTD_SCRIPT a module-level variable.
17
Usage: runlaunchpad.py [-r librarian,sftp,authserver,buildsequencer] [<zope args>]
18
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
19
$Id: z3.py 25266 2004-06-04 21:25:45Z jim $
20
"""
4004.3.10 by jml at canonical
Move guts of runlaunchpad.py into launchpad/scripts/runlaunchpad.py
21
22
import os
1784 by Canonical.com Patch Queue Manager
[r=spiv] Run Librarian on launchpad startup if requested
23
import sys
24
25
if sys.version_info < (2, 4, 0):
26
    print ("ERROR: Your python version is not supported by Launchpad."
27
            "Launchpad needs Python 2.4 or greater. You are running: " 
28
            + sys.version)
29
    sys.exit(1)
30
4002.5.6 by Barry Warsaw
Actually, I don't think we /have/ to care about the site list's owner and
31
from configs import generate_overrides
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
32
4004.3.10 by jml at canonical
Move guts of runlaunchpad.py into launchpad/scripts/runlaunchpad.py
33
34
def set_up_sys_path(program):
4004.3.14 by jml at canonical
'make run' only runs webserver & librarian. 'make run_all' runs everything.
35
    basepath = filter(None, sys.path)
4004.3.10 by jml at canonical
Move guts of runlaunchpad.py into launchpad/scripts/runlaunchpad.py
36
    src = 'lib'
37
    here = os.path.dirname(os.path.abspath(program))
38
    srcdir = os.path.join(here, src)
39
    sys.path = [srcdir, here] + basepath
3973.1.75 by Steve Alexander
show devmode status in the main template. include standard style.css file from main template only when in devmode, otherwise include +style-slimmer.css that is generated in runlaunchpad.py when launchpad is started.
40
41
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
42
def run(argv=list(sys.argv)):
1831 by Canonical.com Patch Queue Manager
New config machinery, database helpers and oddsnsods required for staging
43
    # Sort ZCML overrides for our current config
44
    generate_overrides()
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
45
46
    # setting python paths
47
    program = argv[0]
4004.3.10 by jml at canonical
Move guts of runlaunchpad.py into launchpad/scripts/runlaunchpad.py
48
    set_up_sys_path(program)
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
49
1937 by Canonical.com Patch Queue Manager
[r=jamesh] Common PID file handing module
50
    # Import canonical modules here, after path munging
4004.3.10 by jml at canonical
Move guts of runlaunchpad.py into launchpad/scripts/runlaunchpad.py
51
    from canonical.launchpad.scripts.runlaunchpad import start_launchpad
52
53
    start_launchpad(argv)
4004.3.1 by jml at canonical
Extract copy-and-pasted-Twisted-daemon-launching logic into separate class.
54
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
55
56
if __name__ == '__main__':
57
    run()