~launchpad-pqm/launchpad/devel

809 by Canonical.com Patch Queue Manager
Nuke some arch-tags
1
#! /usr/bin/env python2.3
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
##############################################################################
15
"""Start script for Soyuz: loads configuration and starts the server.
16
17
$Id: z3.py 25266 2004-06-04 21:25:45Z jim $
18
"""
19
import os
20
import sys
21
22
basepath = filter(None, sys.path)
23
24
def run(argv=list(sys.argv)):
25
26
    if sys.version_info < ( 2,3,4 ):
27
        print """\
28
        ERROR: Your python version is not supported by Zope3.
29
        Zope3 needs Python 2.3.4 or greater. You are running:""" + sys.version
30
        sys.exit(1)
31
32
    # Refuse to run without principals.zcml
33
    if not os.path.exists('principals.zcml'):
34
        print """\
35
        ERROR: You need to create principals.zcml
36
37
        The file principals.zcml contains your "bootstrap" user
38
        database. You aren't going to get very far without it.  Start
39
        by copying sample_principals.zcml and then modify the
40
        example principal and role settings.
41
        """
42
        sys.exit(1)
43
44
    # setting python paths
45
    program = argv[0]
46
47
    src = 'lib'
48
    here = os.path.dirname(os.path.abspath(program))
49
    srcdir = os.path.abspath(src)
50
    sys.path = [srcdir, here] + basepath
51
52
    from zope.app.server.main import main
53
    main(argv[1:])
54
55
56
if __name__ == '__main__':
57
    run()