~hardware-certification/zope3/certify-staging-2.5

« back to all changes in this revision

Viewing changes to bin/.svn/text-base/mkzopeinstance.svn-base

  • Committer: Marc Tardif
  • Date: 2008-04-26 19:03:34 UTC
  • Revision ID: cr3@lime-20080426190334-u16xo4llz56vliqf
Initial import.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python2.4
 
2
##############################################################################
 
3
#
 
4
# Copyright (c) 2004 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
"""Script to create a new Zope instance home.
 
16
 
 
17
$Id$
 
18
"""
 
19
 
 
20
import os
 
21
import sys
 
22
 
 
23
here = os.path.dirname(os.path.realpath(__file__))
 
24
swhome = os.path.dirname(here)
 
25
 
 
26
from_checkout = os.path.isdir(os.path.join(swhome, ".svn"))
 
27
 
 
28
for parts in [
 
29
    ("src",), 
 
30
    ("lib", "python"), 
 
31
    ("lib64", "python"), 
 
32
    ("Lib", "site-packages"),
 
33
    ]:
 
34
    d = os.path.join(swhome, *(parts + ("zope", "app", "appsetup")))
 
35
    if os.path.isdir(d):
 
36
        d = os.path.join(swhome, *parts)
 
37
        sys.path.insert(0, d)
 
38
        break
 
39
else:
 
40
    try:
 
41
        import zope.app.server
 
42
    except ImportError:
 
43
        print >>sys.stderr, "Could not locate Zope software installation!"
 
44
        sys.exit(1)
 
45
 
 
46
 
 
47
from zope.app.server.mkzopeinstance import main
 
48
 
 
49
 
 
50
sys.exit(main(from_checkout=from_checkout))