[Zope-Checkins] CVS: Zope/lib/python/Controller - TextBlockFormatter.py:1.1.2.1 ZopeCtl.py:1.1.2.1 __init__.py:1.1.2.1 directives.csv:1.1.2.1 directives.py:1.1.2.1 directives.txt:1.1.2.1 makeconfigfile.py:1.1.2.1 makedirectives.py:1.1.2.1

Chris McDonough chrism@zope.com
Mon, 26 Aug 2002 02:22:38 -0400


Update of /cvs-repository/Zope/lib/python/Controller
In directory cvs.zope.org:/tmp/cvs-serv29520/lib/python/Controller

Added Files:
      Tag: chrism-install-branch
	TextBlockFormatter.py ZopeCtl.py __init__.py directives.csv 
	directives.py directives.txt makeconfigfile.py 
	makedirectives.py 
Log Message:
More work on my Zope2 installer branch.  The branch is fully functional
at this point, at least on Linux (try it!).  The goal is to allow
a './configure; make; make install' Zope source installation possible. 

- The 'configure' step now checks for large file support
  and will only allow configuration to continue if you
  say "yes, I want to screw myself later." ;-)

- Replaced 'zctl' with Tres' 'zopectl'.  In the process,
  refactored zopectl so that it uses a Squid-like config file.
  The config file consists of "directives", each of
  which has a particular set of possible values explained
  in the config file.  The config file provides a uniform
  front-end to the mish-mash of environment variables
  and command-line switches that you normally need to
  deal with when you configure a Zope instance.

- Created a new package in software_home named Controller
  which holds the zctl libraries and some useful scripts
  to create directives.

- Merged HEAD changes onto branch.



=== Added File Zope/lib/python/Controller/TextBlockFormatter.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 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
# 
##############################################################################
"""
Revision information:
$Id: TextBlockFormatter.py,v 1.1.2.1 2002/08/26 06:22:37 chrism Exp $
"""
import string, math

def format(text, max_width=80, indent=0, trailing_lines_indent_more=0):
    text = string.expandtabs(string.replace(text, '\r', ''))
    lines = string.split(text, '\n')
    aggregate = []
    for line in lines:
        if len(line) <= max_width-1:
            # this line is short enough to output
            aggregate.append(line)
        else:
            lines = splitlongline(line, max_width)
            aggregate.extend(lines)
    out = []
    i = 0
    for line in aggregate:
        spaces = ' ' * indent
        if i != 0 and trailing_lines_indent_more:
            spaces = spaces + (' ' * trailing_lines_indent_more)
        out.append('%s%s' % (spaces, line))
        i = i + 1
    return string.join(out, '\n')

def splitword(word, max_width=80, linepos=0):
    # some lines may have single words that exceed the max_width
    # We want to break apart long words into as many chunks as necessary
    if len(word) <= max_width:
        return [word]
    first_chunk_len = max_width-1-linepos
    firstchunk = word[:first_chunk_len]
    word = word[first_chunk_len:]
    numchunks = int(math.ceil(len(word) / float(max_width-1)))
    index = 0
    tmp = [firstchunk]
    for chunknum in range(numchunks):
        chunk = word[index:index+max_width-1]
        tmp.append(chunk)
        index = index + max_width-1
    return tmp
    
def splitlongline(line, max_width=80):
    # split a "long" line defined by max_width into a list of lines
    line = string.strip(line)
    words = string.split(line, ' ')
    wordnum = 0
    # iterate over all the words in the line, extending the word list
    # necessary for too-long words
                
    aggregate = []
    linelen = 0
    wordnum = 0
    while words:
        word = words.pop(0)
        if not word: continue
        if len(word) > max_width:
            new_words = splitword(word, max_width, linelen)
            word = new_words[0]
            for new_word in new_words[1:]:
                words.insert(wordnum, new_word)
                wordnum = wordnum + 1
        if words:
            next_word = words[0]
        else:
            next_word = None
        if next_word is None:
            aggregate.append(word)
            wordnum = wordnum + 1
            continue
        maybe_len = linelen + len(word) + len(next_word)
        if maybe_len >= max_width-1:
            aggregate.append(word)
            aggregate.append(None)
            linelen = 0
        else:
            aggregate.append(word)
            linelen = linelen + len(word) + 1
        wordnum = wordnum + 1

    s = ""
    last = None
    for item in aggregate:
        if item is None:
            s = '%s\n' % s
        elif last is None:
            s = '%s%s' % (s, item)
        else:
            s = '%s %s' % (s, item)
        last = item
    return string.split(s, '\n')

long = """
To turn a component into a product you must fulfill many contracts. For the most part these contracts are not yet defined in terms of interfaces. Instead you must subclass from base classes that implement the contracts. This makes building products confusing, and this is an area that we are actively working on improving.  Hereisalonglinethatshouldbecaughtandbrokenupbytheformatter,hopefullyitllgetsplitupwhenirunitthroughthere."""
long2 = """
Hereisalonglinethatshouldbecaughtandbrokenupbytheformatter,hopefullyitllgetsplitupwhenirunitthroughthere."""
long3 = """
To turn a component into a product you must fulfill many contracts. For the most part these contracts are not yet defined in terms of interfaces.

Instead you must subclass from base classes that implement the contracts. This makes building products confusing, and this is an area that we are

actively working on improving.  Hereisalonglinethatshouldbecaughtandbrokenupbytheformatter,hopefullyitllgetsplitupwhenirunitthroughthere."""

if __name__ == '__main__':
    print format(long, 60, 10)
    print format(long)
    print format(long2, 60, 10)
    print format(long2)
    print format(long3, 60, 10)
    print format(long3)





=== Added File Zope/lib/python/Controller/ZopeCtl.py === (547/647 lines abridged)
"""
    Generic Zope controller.
"""

import getopt
import readline
import os
import sys
import re
import signal
import directives
_marker = []

def normalizeDocstring( bound_method ):

    doc = bound_method.__doc__
    lines = doc.split( '\n' )
    lines = [ line.strip() for line in lines ]
    return '\n'.join( lines )

class ZopeCtl:
    """
        Workhorse engine for controlling the appserver.
    """
    config = None


    def __init__( self, reporter, conf_file='zope.conf' ):
        self._reporter = reporter
        self._config_file = conf_file

    #
    #   Command implementation
    #
    def start( self, arg ):
        """
            Start the Zope appserver.

            Syntax:  start [z2_options]

            All options are passed to the z2 command line.
        """
        # XXX:    We currently do this by using os.system to run z2.py;
        #           a better implementation would just fork and start
        #           Zope using config file info.
        self.configure(1)

        import sys
        cmdline = '%s %s/z2.py %s %s' % ( sys.executable
                                        , self.config['zope_home']

[-=- -=- -=- 547 lines omitted -=- -=- -=-]

        if default is _marker:
            return None
        return default
    
    def activateEnvironment(self):
        for k,v in self.environs.items():
            os.environ[k] = str(v)

        pp = os.environ.get( 'PYTHONPATH' )

        if pp is None:
            pp = []
        else:
            pp = pp.split( ':' )

        if self['software_home'] in pp:
            return
        
        pp.insert( 0, ( self['software_home'] ) )

        os.environ[ 'PYTHONPATH' ] = ':'.join( pp )

    def getCommandLine(self):
        # need to strip keys here because we disambiguate between multi
        # valued-keys by munging them with spaces.  shoot me. ;-)
        commands = ['%s %s' % (k.strip(), v) for k, v in self.commands.items()]
        return "-X %s" % ' '.join(commands)

    def getMainPID(self):
        return self.getAllPIDs()[-1]
    
    def getAllPIDs( self ):
        client_home = self['client_home']
        if client_home is None:
            client_home = os.path.join(self['INSTANCE_HOME'], 'var')

        pidfile = os.path.join(client_home, 'Z2.pid')
        
        for line in open( pidfile ).readlines():
            pids = line.split()
            if pids:
                return [ int(x.strip()) for x in pids ]


class ConfigParseError(Exception):
    pass






=== Added File Zope/lib/python/Controller/__init__.py ===
""" marker """


=== Added File Zope/lib/python/Controller/directives.csv ===
CATEGORY	DIRECTIVE	DESC	TYPE	VALTYPE	INFLUENCES	META_DEFAULT	DEFAULT	EXAMPLE
general	instance_home	The path to the data files, local product files, import directory, and Extensions directory used by Zope.  One software_home can support many instance_homes.	env	path	INSTANCE_HOME	none (required)	None	/home/chrism/projects/sessions
general	software_home	The path to the majority of the Python software files used by Zope.	env	path	SOFTWARE_HOME	none (required)	None	/home/chrism/software/Trunk/lib/python
general	zope_home	The 'top-level' Zope software directory (home of the ZServer directory, the doc directory, the utilities directory, etc.)	env	path	ZOPE_HOME	none (required)	None	/home/chrism/software/Trunk
general	client_home	The directory in which a running Zope's process identifier files are placed.	env	path	CLIENT_HOME	unset	None	/home/chrism/projects/sessions/var
admin	debug_mode	If this directive is set to 'on', it causes the Zope process to not detach from the controlling terminal after it is run.  It also influences the behavior of some Zope objects at runtime (for example, when debug mode is "on", you are able to view changes made to DTMLFile and PageTemplateFile objects immediately; When it is 'off', you must restart the server to see the changes.  Setting this to 'off' when Zope is in a production environment is encouraged, as it speeds execution.	cmd	onoff	-D	on	None	on
admin	effective_user	If you intend to run Zope as the "root" user, you must supply this directive with an effective username or userid number to which Zope will 'suid' after the server ports are bound.  This directive only works under UNIX and if Zope is started as the root user.	cmd	string	-u	unset	None	chrism
admin	inhibit_product_installation	If this  directive is set, the 'product installation' step performed by Zope at startup is prevented.  This can speed Zope startup time, but it can also cause your Control_Panel Product list to become desynchronized with the contents of your Products directories.  If the 'zeo_client_name' directive is set, and this directive is unset, this directive will be implicitly turned on.  By default, it is off.	env	onoff	FORCE_PRODUCT_LOAD	unset	None	on
admin	locale	Enable locale (internationalization) support by supplying a locale name to be used.  See your operating system documentation for locale information specific to your system.  If your Python module does not support the locale module, or if the requested locale is not supported by your system, an error will be raised and Zope will not start.	cmd	string	-L	unset	None	fr_FR
admin	number_of_threads	Specify the number of threads that Zope will use to service requests.  The default is 4.	cmd	int	-t	4	None	10
admin	python_check_interval	Specify an integer representing the Python interpreter "check interval"  This interval determines how often the interpreter checks for perioding things such as thread switches and signal handlers.  The Zope default is 500, but you may want to experiment with other values in order to attempt to increae performance in your particular environment.	cmd	int	-i	500	None	1000
admin	use_daemon_process	If this directive is set to 'on', Zope will be managed by a 'daemon' process which will restart the Zope process if it dies unexpectedly.	cmd	onoff	-Z	on	None	on
admin	zserver_read_only_mode	If this directive is set to 'on', it will cause Zope to inhibit the creation of log files and pid files.  Access and event log files will be presented on standard output.  Setting this directive 'on' causes pcgi, fastcgi, and daemon-related directives to have no effect.	cmd	onoff	-r	off	None	on
log	acccess_syslog_facility	Same as 'event_syslog_facility', only for the "access" log data (z2.log data).	env	string	ZSYSLOG_ACCESS_FACILITY	unset	None	local7
log	access_log_filename	The file path of the Zope 'access' log (z2.log) which is written in the combined logfile format.  The access log will be printed to standard output if the 'zserver_read_only' directive is set to 'on', regardless of this setting.	cmd	string	-I	INSTANCE_HOME/var/z2.log	None	/home/chrism/projects/sessions/z2.log
log	access_syslog_path	Same as event_syslog_path, only for the "access" log data (z2.log data).	env	path	ZSYSLOG_ACCESS	unset	None	/dev/log
log	access_syslog_server	Same as event_syslog_path, only for the 'access' data (z2.log data).	env	string	ZSYSLOG_ACCESS_SERVER	unset	None	Syslog.example.com:514
log	event_log_file	Path to the Zope event log for debugging information.	env	path	EVENT_LOG_FILE	console	''	/home/chrism/projects/var/event.log
log	event_log_severity	Filter events that can be written to the event log by priority.  A higher priority means fewer events will be written.  Choose one of (300, 200, 100, 0, -100, -200, or -300).  Descriptions of the integer levels are as follows: 300=PANIC, 200=ERROR, 100=WARNING, 0=INFO, -100=BLATHER, -200=DEBUG, -300=TRACE).	env	string	EVENT_LOG_SEVERITY	0	None	100
log	event_syslog_facility	The facility used when the event log is being written to syslog (when 'event_syslog_path' or 'event_syslog_server' is set).	env	string	ZSYSLOG_FACILITY	user	None	local7
log	event_syslog_path	Setting this directive will cause Zope to write the event log to syslog on the named UNIX domain socket on the local host.  This only works on UNIX.  It is overridden by specifying 'event_syslog_server'.	env	path	ZSYSLOG	unset	None	/dev/log
log	event_syslog_server	Specify a machine and udp port to send event data to over syslog.  The format of this directive should be 'machine_name:port'.	env	string	ZSYSLOG_SERVER	unset	None	syslog.example.com:514
log	trace_log_filename	The file path of the Zope 'trace' log which contains detailed request information which can later be interpreted by the requestprofiler.py script in the utilities directory. 	cmd	string	-M	unset	None	/home/chrism/projects/sessions/trace.log
misc	default_structured_text_header_level	Set the default starting HTML header level for structured text documents.  The default is 3, which implies that  top-level headers will be created with an <H3> tag.	env	int	STX_DEFAULT_LEVEL	3	None	1
misc	maximum_security_manager_stack_size	This variable allows you to customize the size of the Zope SecurityManager stack.  You shouldn't change this unless you know what it means.	env	int	Z_MAX_STACK_SIZE	100	None	200
misc	publisher_profile_file	Causing this directive to point to a file on the filesystem will cause Zope's profiling capabilities to be enabled.  For more information, see the Debug -> Profiling tab of the Control_Panel.	env	path	PROFILE_PUBLISHER   unset	unset	None	/home/chrism/projects/sessions/var/profile/dat
misc	webdav_source_user_agents	Setting this directive enabls the retrieval of the *source* of Zope documents through the standard HTTP port instead of via a WebDAV source port (which are enabled via the 'webdav_source_server_ports' directive).   The value should be a regular expression that is matched against the user-agent string of the client.  Only clients which have a user-agent which match this regex will obain the source of the document via DAV on the normal HTTP port.	env	string	WEBDAV_SOURCE_PORT_CLIENTS	unset	None	cadaver.*
network	dns_server_address	Specify the ip address of your DNS server in order to cause resolved hostnames to be written to Zope's access log.  By default, Zope will not resolve hostnames unless this is set.	cmd	string	-d	unset	None	127.0.0.1
network	ip_address	The IP address on which Zope's various server protocol iimplementations will listen for requests.  If this is unset, Zope will listen on all IP addresses supported by the machine.	cmd	int	-a	unset	None	127.0.0.1
protocol	default_http_realm	The HTTP "Realm" header value sent by this Zope instance.  This value often shows up in basic authentication dialogs.	env	string	Z_REALM	Zope	None	Slipknot
protocol	fastcgi_resource_path_or_port	Either a path (for unix domain sockets) or port number (for inet sockets) for the FastCGI server. 	cmd	string	-F	unset	None	/home/chrism/projects/sessions/fastcgi.soc
protocol	force_http_connection_close	If set to on, this directive causes Zope to close all HTTP connections regardless of the 'Connection:' header (or lack thereof) specified by the client.	cmd	onoff	-C	off	None	on
protocol	ftp_server_ports	A space-separated list of TCP port numbers on which Zope will listen for FTP requests.	cmd	stringlist	-f	8021	8021	8021 21
protocol	http_server_ports	A space-separated list of TCP port numbers on which Zope will listen for HTTP requests.	cmd	stringlist	-w	8080	8080	8080 80
protocol	icp_server_ports	A space-separated list of TCP port numbers on which Zope will listen for Internet Cache Protocol requests.	cmd	stringlist	--icp	unset	None	3130
protocol	monitor_server_ports	A space-separated list of TCP port numbers on which Zope will listen for requests from the Medusa monitor client.  Useful for debugging purposes, but dangerous to leave open.	cmd	stringlist	-m	unset	None	8090 90
protocol	pcgi_resource_path	Path to the PCGI 'resource' file.  If the file doesn't exist, PCGI is disabled.	cmd	path	-p	unset	None	/home/chrism/projects/sessions/pcgi.soc
protocol	webdav_source_server_ports	A space-separated list of TCP port numbers on which Zope will listen for HTTP/WebDAV 'source' requests.  The source of the Zope object requested will be returned when requests are made to this set of ports, as opposed to the rendered version which is returned when the normal HTTP port is consulted.	cmd	stringlist	-W	9800	9800	9800 9801
security	automatically_quote_dtml_request_data	Set this directive to 'off' in order to disable the autoquoting of implicitly retrieved REQUEST data by DTML code which contains a '<' when used in <dtml-var> construction.  When this directive is 'on', all data implicitly retrieved from the REQUEST in DTML (as opposed to addressing REQUEST.somevarname directly) that contains a '<' will be HTML-quoted when interpolated via a <dtml-var> or &dtml- construct.   This mitigates the possibility that DTML programmers will leave their sites open to a "client-side trojan" attack.	env	onoff	ZOPE_DTML_REQUEST_AUTOQUOTE	on	None	on
security	perform_authentication_checking	Set this directive to 'off' to cause Zope to allow unauthenticated access to all resources.  DANGEROUS.	env	onoff	ZSP_AUTHENTICATED_SKIP	on	None	on
security	perform_ownership_checking	Set this directive to 'off' to cause Zope to ignore ownership checking when attempting to execute "through the web" code.  By default, this directive is on in order to prevent 'trojan horse' security problems whereby a user with less privilege can cause a user with more privilege to execute dangerous code.	env	onoff	ZSP_OWNEROUS_SKIP	on	None	on
security	security_policy_implementation	Set this directive to 'PYTHON' to use a pure-Python implementation of Zope's default security policy.  The default value for this directive is 'C".  Setting it to PYTHON causes Zope to run more slowly, but it can be helpful when attempting to debug security-related application failures.	env	string	ZOPE_SECURITY_POLICY	C	None	PYTHON
sessions	maximum_number_of_session_objects	An integer value representing the number of items to use as a "maximum number of subobjects" value of the '/temp_folder/session_data' transient object container.	env	int	ZSESSION_OBJECT_LIMIT	1000	None	10000
sessions	session_add_notify_script_path	An optional fill Zope path name of a callable object to be set as the "script to call on object addition" of the sessioN_data transient object container created in the /temp_folder folder at startup.	env	path	ZSESSION_ADD_NOTIFY	unset	None	/scripts/add_notifier
sessions	session_delete_notify_script_path	An optional fill Zope path name of a callable object to be set as the "script to call on object deletion" of the sessioN_data transient object container created in the /temp_folder folder at startup.	env	path	ZSESSION_DEL_NOTIFY	unset	None	/scripts/del_notifier
sessions	session_timeout_minutes	An integer value representing the number of minutes to be used as the "data object timeout" of the '/temp_folder/session_data' transient object container.	env	int	ZSESSION_TIMEOUT_MINS	20	None	30
url	suppress_all_access_rules 	If this directive is set to on, no access rules in your Zope site will be executed.  This is useful if you "lock yourself out" of a particular part of your site by setting an improper access rule.	env	onoff	SUPPRESS_ACCESRULE	off	None	on
url	suppress_all_site_roots	If this directive is set to on, no site roots in your Zope site will be effective.  This is useful if you "lock yourself out" of a particular part of your site by setting an improper site root.	env	onoff	SUPPRESS_SITEROOT	off	None	on
zodb	database_quota_size	Set this directive to an integer in bytes in order to place a hard limit on the size which the default FileStorage-backed Zope database can grow.  Additions to the database will not be permitted once this filesize is exceeded.	env	int	ZOPE_DATABASE_QUOTA	unset	None	1000000
zodb	read_only_database	This causes the main Zope FileStorage-backed ZODB to be opened in read-only mode.	env	onoff	ZOPE_READ_ONLY	off	None	on
zodb	zeo_client_name	Provide a string value to uniquely identify the local cache files created if this Zope is a ZEO client.  Setting this directive implies setting 'inhibit_product_installation' to 'on' if 'inhibit_product_installation' is left unset.	env	string	ZEO_CLIENT	unset	None	zeo1


=== Added File Zope/lib/python/Controller/directives.py === (430/530 lines abridged)
def stringHandler(s, name, influences, type):
    return {influences:s}

pathHandler = stringHandler

def onoffHandler(s, name, influences, type):
    if type =='env':
        if s == 'on':
            return {influences:'1'}
        else:
            return {influences:'0'}
    else:
        if s == 'on':
            return {influences:''} # nonvalued switch
        else:
            return {}

def intHandler(s, name, influences, type):
    try:
        int(s)
    except:
        raise ValueError, '%s is not a valid integer value for %s' % (s,name)
    return {influences:s}

def stringListHandler(s, name, influences, type):
    l = s.split()
    out = []
    i = 0
    d = {}
    if type == 'env':
        raise ValueError, ('stringListHandler not equipped to handle '
                           'environment settings for %s' % name)
    for item in l:
        # lame, but we use spaces to pad the keys in order to
        # handle multiple of the same command-line switch directives
        padding = ' ' * i
        padded = '%s%s' % (padding, influences)
        d[padded] = item
        i = i + 1
    return d

dispatch = {
    'path':pathHandler,
    'onoff':onoffHandler,
    'string':stringHandler,
    'int':intHandler,
    'stringlist':stringListHandler,
    }



[-=- -=- -=- 430 lines omitted -=- -=- -=-]

    influences = 'ZSESSION_TIMEOUT_MINS'
    value = None
    meta_default = '20'
    example = '30'

class suppress_all_access_rules(EnvironmentDirective):
    desc = 'If this directive is set to on, no access rules in your Zope site will be executed.  This is useful if you \"lock yourself out\" of a particular part of your site by setting an improper access rule.'
    category = 'url'
    valtype  = 'onoff'
    influences = 'SUPPRESS_ACCESRULE'
    value = None
    meta_default = 'off'
    example = ''

class suppress_all_site_roots(EnvironmentDirective):
    desc = 'If this directive is set to on, no site roots in your Zope site will be effective.  This is useful if you \"lock yourself out\" of a particular part of your site by setting an improper site root.'
    category = 'url'
    valtype  = 'onoff'
    influences = 'SUPPRESS_SITEROOT'
    value = None
    meta_default = 'off'
    example = ''

class database_quota_size(EnvironmentDirective):
    desc = 'Set this directive to an integer in bytes in order to place a hard limit on the size which the default FileStorage-backed Zope database can grow.  Additions to the database will not be permitted once this filesize is exceeded.'
    category = 'zodb'
    valtype  = 'int'
    influences = 'ZOPE_DATABASE_QUOTA'
    value = None
    meta_default = 'unset'
    example = '1000000'

class read_only_database(EnvironmentDirective):
    desc = 'This causes the main Zope FileStorage-backed ZODB to be opened in read-only mode.'
    category = 'zodb'
    valtype  = 'onoff'
    influences = 'ZOPE_READ_ONLY'
    value = None
    meta_default = 'off'
    example = ''

class zeo_client_name(EnvironmentDirective):
    desc = 'Provide a string value to uniquely identify the local cache files created if this Zope is a ZEO client.  Setting this directive implies setting \'inhibit_product_installation\' to \'on\' if \'inhibit_product_installation\' is left unset.'
    category = 'zodb'
    valtype  = 'string'
    influences = 'ZEO_CLIENT'
    value = None
    meta_default = 'unset'
    example = 'zeo1'



=== Added File Zope/lib/python/Controller/directives.txt ===
zope_home		    env	    path	general	ZOPE_HOME	    none			os.environ.get('ZOPE_HOME')
software_home		    env	    path	general	SOFTWARE_HOME	    none			os.environ.get('SOFTWARE_HOME')
instance_home		    env	    path	general	INSTANCE_HOME	    none			os.environ.get('INSTANCE_HOME)
client_home		    env	    path	general	CLIENT_HOME	    INSTANCE_HOME/var		None
zeo_client_name		    env	    string	zeo	ZEO_CLIENT	    unset			None			
load_products		    env	    onoff	admin	FORCE_PRODUCT_LOAD  off				None
publisher_profile_file	    env	    path	profile	PROFILE_PUBLISHER   unset			None
suppress_all_access_rules   env	    onoff	url	SUPPRESS_ACCESRULE  off				None
suppress_site_roots	    env	    onoff	url	SUPPRESS_SITEROOT   off				None
event_log_format	    env	    string	log	EVENT_LOG_FORMAT    
event_log_file		    env	    path	log	EVENT_LOG_FILE	    INSTANCE_HOME/var/event.log
event_log_severity	    env	    string	log	EVENT_LOG_SEVERITY  None
event_syslog_path	    env	    path	log	ZSYSLOG		    None
event_syslog_facility	    env	    string	log	ZSYSLOG_FACILITY    None
event_syslog_server	    env	    string	log	ZSYSLOG_SERVER	    None
access_syslog_path	    env	    path	log	ZSYSLOG_ACCESS	    None
acccess_syslog_facility	    env	    string	log	ZSYSLOG_ACCESS_FACILITY None

access_syslog_server	    env	    string	log	ZSYSLOG_ACCESS_SERVER	None

default_http_realm':'string', #z_realm
security_policy':'string', #zope_security_policy
ownership_checking':'onoff', #zsp_ownerous_skip
authentication_checking':'onoff', #zsp_authenticated_skip
database_quota':'int', # zope_database_quota
read_only_database':'unknown', # # zope_read_only
session_add_notifier':'zopepath', #zsession_add_notify
session_delete_notifier':'zopepath', #zsession_del_notify
session_timeout_minutes':'int', # zsesssion_timeout_mins
maximum_number_of_session_objects':'int', # zsession_object_limit 
webdav_source_port_clients':'unknown',
default_structured_text_header_level':'int' # stx_default_level(3)
automatically_quote_dtml_request_data':'onoff', # ZOPE_DTML_REQUEST_AUTOQUOTE
maximum_security_manager_stack_size':'int', # Z_MAX_STACK_SIZE
 begin command-line options
http_ports':'intlist', # -w (might be 127.0.0.1:8080 too)
ftp_ports':'intlist', # -f (might be 127.0.0.1:8080 too)
webdav_ports':'intlist', # -W (might be 127.0.0.1:8080 too)
monitor_ports':'intlist', # -m (might be 127.0.0.1:8080 too)
icp_ports':'intlist', # --icp (might be 127.0.0.1:8080 too)
ip_address','int' # -a (default '' for all addresses)
debug_mode':'onoff', # equivalent to Z_DEBUG_MODE=1, default on
read_only':'onoff', # -r 
effective_user':'unknown', # -u (username or uid number)
locale':'string', # -L can be empty string, None is default
number_of_threads':'int', # -t
python_check_interval':'int', # -i
dns_server_address':'string', # -d ('' or unset means dont use)
access_log_filename':'path', # -l (default var/Z2.log)
trace_log_filename':'path', # -M
use_zdaemon_process':'onoff', # "-Z ''" means dont, default yes
force_http_connection_close': 'onoff', # -C
pcgi_resource_path':'path', # -p
fastcgi_resource_path':'pathorport', # -F



=== Added File Zope/lib/python/Controller/makeconfigfile.py ===
header_text = ''
from TextBlockFormatter import format

def main():
    f = open('directives.csv', 'r')
    print header_text
    while 1:
        line = f.readline()
        if not line:
            break
        stuff = line.split('\t')
        (category, name, desc, type, valtype, influences, meta_default,
         default, example) = [ x.strip() for x in stuff ]
        desc = format(desc, 70).split('\n')
        print "# Directive: %s" % name
        print "#"
        print "# Description:"
        for line in desc:
            print "#     %s" % line
        print "#"
        influence_desc = (type == 'env' and 'environment variable' or
                          type == 'cmd' and 'command-line switch to z2.py')
        print "# Influences: %s %s" % (influences, influence_desc)
        print "#"
        print "# Default: %s" % meta_default
        print "#"
        if example:
            print "# Example:\n#\n#    %s %s" % (name, example)
            print "#"
        try:
            default = eval(default)
        except:
            default = None
        if default:
            print "%s %s" % (name, default)
        print
        print
        
if __name__=='__main__':
    main()


=== Added File Zope/lib/python/Controller/makedirectives.py ===
header_text = ''

def main():
    f = open('directives.csv', 'r')
    print header_text
    while 1:
        line = f.readline()
        if not line:
            break
        stuff = line.split('\t')
        (category, name, desc, type, valtype, influences, meta_default,
         default, example) = [ x.strip() for x in stuff ]
        quote = (category, name, desc, type, valtype, influences, meta_default,
                 example)
        (category, name, desc, type, valtype, influences, meta_default,
         example) = [x.replace('"', '\\"') for x in quote]
        quote = (category, name, desc, type, valtype, influences, meta_default,
                 example)
        (category, name, desc, type, valtype, influences, meta_default,
         example)= [x.replace("'", "\\'") for x in quote]
        print
        if type =='env':
            print "class %s(EnvironmentDirective):" % name
        else:
            print "class %s(CommandLineDirective):" % name
        print "    desc = '%s'" % desc
        print "    category = '%s'" % category
        print "    valtype  = '%s'" % valtype
        print "    influences = '%s'" % influences
        print "    value = %s" % default
        print "    meta_default = '%s'" % meta_default
        print "    example = '%s'" % example
    
if __name__=='__main__':
    main()