[Zope-Checkins] CVS: Zope/inst/skel/inst/skel - custom_zodb.py:1.1.2.1 zope.conf:1.1.2.1

Chris McDonough chrism@zope.com
Sun, 29 Sep 2002 17:46:26 -0400


Update of /cvs-repository/Zope/inst/skel/inst/skel
In directory cvs.zope.org:/tmp/cvs-serv12114/inst/skel/inst/skel

Added Files:
      Tag: chrism-install-branch
	custom_zodb.py zope.conf 
Log Message:
Updates to the chrism-install-branch:

  - Uses distutils (setup.py) to install all software kept in the
    'lib/python' directory.  This means that the setup.py file
    (which has moved into the inst directory) will need to be maintained
    as new packages, files, and directories are added.  This is
    painful, but it's "the right thing".  It is a departure from the
    past inasmuch as (if this branch is merged into the head at some
    point) when people add stuff to the Zope tree, they will need to
    be careful to update the setup.py file as well.  I know this will become
    incredibly problematic.  To make things easier, it might be
    a reasonable thing to autogenerate a setup.py file based on the
    current state of the Zope tree.  But this is not done yet.
    BTW, many thanks to Matt Hamilton for making the incredible setup.py file
    for all Zope packages.

  - No longer copies the build directory wholesale to create a
    ZOPE_HOME.  Instead 'make install' copies a 'skeleton' directory to the 
    target dir using a custom Python installer and writes out
    files that need post-processing (.in files) to places in the
    hierarchy as needed via the Makefile.  This prevents a lot of
    cruft from reaching the target directory (build directories,
    emacs backup files, etc.)

  - Has an improved 'make instance' implementation which also uses
    a skeleton directory and a similar install.

  - Does away with much cruft in the 'inst' directory lefover from
    band-aids that were produced in the past.

Concessions were made to the realities of moving directories in CVS
for this go-around.  It is desirable to move lots of the current
"top-level" directories (import, var, utilities, Extensions, pcgi, etc.)
into the "skeleton" directory for the kind of install strategy implemented
by this branch, but this is not reasonable as we would divorce these 
packages from updates received on the head if were were to do so now.
If we merge this branch into the head, we will do away with the workarounds
and move the directories.
  


=== Added File Zope/inst/skel/inst/skel/custom_zodb.py ===
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""
Create the storage for the Zope appserver.  If you don't know what
you're doing, do not change this file or remove it from your instance
home or your Zope instance will likely not work properly, especially if
you use ZEO.
"""

__version__='$Revision: 1.1.2.1 $'[11:-2]

import warnings, traceback
import sys, os
import zLOG
import ZODB
from Controller.Directives import DirectiveRegistry as reg

CLIENT_HOME = reg['client_home']

if reg['use_zeo_server']:
    port         = None
    path         = None
    hostname     = reg['zeo_storage_server_hostname']
    port_or_path = reg['zeo_storage_server_path_or_port']
    storage_name = reg['zeo_storage_server_storagename'] or '1'
    cache_size   = reg['zeo_client_cache_size'] or 200000000
    debug        = reg['zeo_client_debug'] or 0
    cache_dir    = reg['zeo_client_cache_directory'] or CLIENT_HOME
    max_disconn  = reg['zeo_client_max_disconnect_poll'] or 300
    min_disconn  = reg['zeo_client_min_disconnect_poll'] or 5
    wait         = reg['zeo_client_wait_for_server_on_startup'] or 0
    client_name  = reg['zeo_client_name'] or ''
    try:
        port = int(port_or_path)
        conn = (hostname, port)
    except:
        conn = port_or_path
    try:
        import ZServer
        import ZEO.ClientStorage
	name = "%s, %s, %s" % (hostname, port_or_path, storage_name)
        Storage = ZEO.ClientStorage.ClientStorage(
            conn, storage=storage_name, cache_size=cache_size,
            name=name, client=client_name, debug=debug, var=cache_dir,
            min_disconnect_poll=min_disconn, max_disconnect_poll=max_disconn,
            wait_for_server_on_startup=wait)
    except:
        zLOG.LOG('custom_zodb', 100, 'Could not use ZEO!',error=sys.exc_info())
        traceback.print_exc()
        err = ('Could not successfully start Zope due to ZEO configuration '
               'error.  Clues exist in the traceback printed above.  Check '
               'your zope.conf file for a misconfiguration.')
        warnings.warn(err)
        # exit the process instead of silently using a FileStorage
        sys.exit(255)

else:
    from ZODB import FileStorage
    default = os.path.join(CLIENT_HOME, 'Data.fs')
    filename = reg['zodb_filestorage_filepath'] or default
    Storage = FileStorage.FileStorage(filename)

# use environment to try to get cache size and pool size
# parameters
pool_size  = reg['zodb_db_pool_size'] or 7
cache_size = reg['zodb_db_cache_size'] or 5000

DB=ZODB.DB(Storage, pool_size=pool_size, cache_size=cache_size)


=== Added File Zope/inst/skel/inst/skel/zope.conf === (983/1083 lines abridged)
###############################################################################
# Welcome to Zope 2.
###############################################################################
#
# This is the default Zope configuration file.  The default Zope configuration
# file shows what the default configuration directives are, and show examples
# for each directive.  To declare a directive, make sure that you add it
# to a line that does not begin with '#'.
#
# Directive: zope_home
#
# Description:
#     The 'top-level' Zope software directory (home of the Zserver
#     directory, the doc directory, the utilities directory, etc.)
#
# Influences: ZOPE_HOME environment variable
#
# Default:
#
#     The directory in which the 'zope.py' file (or other executable file
#     used to start Zope) lives.
#
# Example:
#
#    zope_home /home/chrism/software/Trunk


# Directive: instance_home
#
# Description:
#     The path to the data files, local product files, import directory,
#     and Extensions directory used by Zope.
#
# Influences: INSTANCE_HOME environment variable
#
# Default: The current working directory when Zope is started.
#
# Example:
#
#    instance_home /home/chrism/projects/sessions


# Directive: software_home
#
# Description:
#     The path to the majority of the Python software files used by Zope. One
#     software_home can support many instance_homes.
#
# Influences: SOFTWARE_HOME environment variable
#

[-=- -=- -=- 983 lines omitted -=- -=- -=-]

# Directive: zeo_client_min_disconnect_poll
#
# Description:
#     The minimum number of seconds that a ClientStorage will wait before
#     retrying a connection after a failure. The default is 5 if this is
#     left unset.
#
# Influences: zope.py configuration
#
# Default: 5
#
# Example:
#
#    zeo_client_min_disconnect_poll 10


# Directive: zeo_client_max_disconnect_poll
#
# Description:
#     The maximum number of seconds that a ClientStorage will wait before
#     retrying a connection after a failure. The default is 300 if this is
#     left unset.
#
# Influences: zope.py configuration
#
# Default: 300
#
# Example:
#
#    zeo_client_max_disconnect_poll 300


# Directive: zeo_client_wait_for_server_on_startup
#
# Description:
#     If this is set to "on", the ZEO ClientStorage will wait for a
#     connection to its storage before serving data. If this is set to
#     "off", the ZEO ClientStorage will attempt to serve data out of its
#     cache file at startup even if it cannot make a connection to a
#     storage server.
#
# Influences: zope.py configuration
#
# Default: off
#
# Example:
#
#    zeo_client_wait_for_server_on_startup on