~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
7049.2.9 by Jonathan Lange
Review comments.
17
Usage: runlaunchpad.py [-r librarian,sftp,buildsequencer]
6887.1.12 by Martin Albisetti
Styling tweaks
18
          [<zope args>]
4004.3.15 by Jonathan Lange
Move module docstring to script. Make TWISTD_SCRIPT a module-level variable.
19
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
20
$Id: z3.py 25266 2004-06-04 21:25:45Z jim $
21
"""
4004.3.10 by jml at canonical
Move guts of runlaunchpad.py into launchpad/scripts/runlaunchpad.py
22
23
import os
1784 by Canonical.com Patch Queue Manager
[r=spiv] Run Librarian on launchpad startup if requested
24
import sys
25
26
if sys.version_info < (2, 4, 0):
27
    print ("ERROR: Your python version is not supported by Launchpad."
6887.1.12 by Martin Albisetti
Styling tweaks
28
            "Launchpad needs Python 2.4 or greater. You are running: "
1784 by Canonical.com Patch Queue Manager
[r=spiv] Run Librarian on launchpad startup if requested
29
            + sys.version)
30
    sys.exit(1)
31
4002.5.6 by Barry Warsaw
Actually, I don't think we /have/ to care about the site list's owner and
32
from configs import generate_overrides
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
33
4004.3.10 by jml at canonical
Move guts of runlaunchpad.py into launchpad/scripts/runlaunchpad.py
34
35
def set_up_sys_path(program):
6887.1.11 by Martin Albisetti
* Fixed comment
36
    # Get rid of any empty strings that may appear in sys.path and cause
37
    # random grief.
4004.3.14 by jml at canonical
'make run' only runs webserver & librarian. 'make run_all' runs everything.
38
    basepath = filter(None, sys.path)
4004.3.10 by jml at canonical
Move guts of runlaunchpad.py into launchpad/scripts/runlaunchpad.py
39
    src = 'lib'
40
    here = os.path.dirname(os.path.abspath(program))
41
    srcdir = os.path.join(here, src)
42
    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.
43
44
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
45
def run(argv=list(sys.argv)):
1831 by Canonical.com Patch Queue Manager
New config machinery, database helpers and oddsnsods required for staging
46
    # Sort ZCML overrides for our current config
47
    generate_overrides()
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
48
49
    # setting python paths
50
    program = argv[0]
4004.3.10 by jml at canonical
Move guts of runlaunchpad.py into launchpad/scripts/runlaunchpad.py
51
    set_up_sys_path(program)
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
52
1937 by Canonical.com Patch Queue Manager
[r=jamesh] Common PID file handing module
53
    # Import canonical modules here, after path munging
4004.3.10 by jml at canonical
Move guts of runlaunchpad.py into launchpad/scripts/runlaunchpad.py
54
    from canonical.launchpad.scripts.runlaunchpad import start_launchpad
55
56
    start_launchpad(argv)
4004.3.1 by jml at canonical
Extract copy-and-pasted-Twisted-daemon-launching logic into separate class.
57
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
58
59
if __name__ == '__main__':
60
    run()