zope.app.server-3.6.0/ 0000755 0001771 0002004 00000000000 11542403754 014452 5 ustar menesis menesis zope.app.server-3.6.0/CHANGES.txt 0000644 0001771 0002004 00000001426 11542403742 016263 0 ustar menesis menesis =======
CHANGES
=======
3.6.0 (2011-03-23)
------------------
- Moved ``zope.app.server.zpasswd`` to ``zope.password.zpasswd``.
3.5.0 (2009-12-19)
------------------
- Use ``zope.password`` instead of ``zope.app.authentication``
- Depend on new ``zope.processlifetime`` implementations instead of
using BBB imports from ``zope.app.appsetup``.
3.4.2 (2008-08-18)
------------------
- Moved a doctest into a unittest to fix failures in the KGS test suite
(see LP #257954)
3.4.1 (2008-02-25)
------------------
- Fixed restart so that the process exits with a non-zero exit status
so it gets restarted by zdaemon, or an equivalent mechanism.
- Removed the use of ``ThreadedAsync``.
3.4.0 (2007-10-27)
------------------
- Initial release independent of the main Zope tree.
zope.app.server-3.6.0/PKG-INFO 0000644 0001771 0002004 00000003772 11542403754 015560 0 ustar menesis menesis Metadata-Version: 1.0
Name: zope.app.server
Version: 3.6.0
Summary: ZServer integration for Zope 3 Applications
Home-page: http://cheeseshop.python.org/pypi/zope.app.server
Author: Zope Corporation and Contributors
Author-email: zope-dev@zope.org
License: ZPL 2.1
Description: This package integrates ZServer -- Zope's HTTP and FTP server -- into a Zope 3
application setup. It also defines the script skeleton for a classic Zope 3
application.
=======
CHANGES
=======
3.6.0 (2011-03-23)
------------------
- Moved ``zope.app.server.zpasswd`` to ``zope.password.zpasswd``.
3.5.0 (2009-12-19)
------------------
- Use ``zope.password`` instead of ``zope.app.authentication``
- Depend on new ``zope.processlifetime`` implementations instead of
using BBB imports from ``zope.app.appsetup``.
3.4.2 (2008-08-18)
------------------
- Moved a doctest into a unittest to fix failures in the KGS test suite
(see LP #257954)
3.4.1 (2008-02-25)
------------------
- Fixed restart so that the process exits with a non-zero exit status
so it gets restarted by zdaemon, or an equivalent mechanism.
- Removed the use of ``ThreadedAsync``.
3.4.0 (2007-10-27)
------------------
- Initial release independent of the main Zope tree.
Keywords: zope3 zserver server http ftp wsgi
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Zope Public License
Classifier: Programming Language :: Python
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Framework :: Zope3
zope.app.server-3.6.0/README.txt 0000644 0001771 0002004 00000000250 11542403742 016142 0 ustar menesis menesis This package integrates ZServer -- Zope's HTTP and FTP server -- into a Zope 3
application setup. It also defines the script skeleton for a classic Zope 3
application.
zope.app.server-3.6.0/setup.py 0000644 0001771 0002004 00000005676 11542403742 016177 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
# This package is developed by the Zope Toolkit project, documented here:
# http://docs.zope.org/zopetoolkit
# When developing and releasing this package, please follow the documented
# Zope Toolkit policies as described by this documentation.
##############################################################################
"""Setup for zope.app.server package
"""
import os
from setuptools import setup, find_packages
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
setup(name='zope.app.server',
version='3.6.0',
author='Zope Corporation and Contributors',
author_email='zope-dev@zope.org',
description='ZServer integration for Zope 3 Applications',
long_description=(
read('README.txt')
+ '\n\n' +
read('CHANGES.txt')
),
keywords = "zope3 zserver server http ftp wsgi",
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Zope Public License',
'Programming Language :: Python',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Framework :: Zope3'],
url='http://cheeseshop.python.org/pypi/zope.app.server',
license='ZPL 2.1',
packages=find_packages('src'),
package_dir = {'': 'src'},
namespace_packages=['zope', 'zope.app'],
extras_require = dict(test=['zope.app.testing']),
install_requires=['setuptools',
'zope.app.applicationcontrol',
'zope.app.appsetup >= 3.11',
'zope.app.publication',
'zope.app.wsgi',
'zope.configuration',
'zope.deprecation',
'zope.event',
'zope.interface',
'zope.publisher',
'zope.server',
'zope.password >= 3.6',
'zope.processlifetime',
'zdaemon',
'ZConfig',
'ZODB3',
],
include_package_data = True,
zip_safe = False,
)
zope.app.server-3.6.0/COPYRIGHT.txt 0000644 0001771 0002004 00000000040 11542403742 016552 0 ustar menesis menesis Zope Foundation and Contributors zope.app.server-3.6.0/LICENSE.txt 0000644 0001771 0002004 00000004026 11542403742 016274 0 ustar menesis menesis Zope Public License (ZPL) Version 2.1
A copyright notice accompanies this license document that identifies the
copyright holders.
This license has been certified as open source. It has also been designated as
GPL compatible by the Free Software Foundation (FSF).
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions in source code must retain the accompanying copyright
notice, this list of conditions, and the following disclaimer.
2. Redistributions in binary form must reproduce the accompanying copyright
notice, this list of conditions, and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Names of the copyright holders must not be used to endorse or promote
products derived from this software without prior written permission from the
copyright holders.
4. The right to distribute this software or to use it for any purpose does not
give you the right to use Servicemarks (sm) or Trademarks (tm) of the
copyright
holders. Use of them is covered by separate agreement with the copyright
holders.
5. If any files are modified, you must cause the modified files to carry
prominent notices stating that you changed the files and the date of any
change.
Disclaimer
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
zope.app.server-3.6.0/bootstrap.py 0000644 0001771 0002004 00000003302 11542403742 017034 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Bootstrap a buildout-based project
Simply run this script in a directory containing a buildout.cfg.
The script accepts buildout command-line options, so you can
use the -c option to specify an alternate configuration file.
"""
import os, shutil, sys, tempfile, urllib2
tmpeggs = tempfile.mkdtemp()
ez = {}
exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
).read() in ez
ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
import pkg_resources
cmd = 'from setuptools.command.easy_install import main; main()'
if sys.platform == 'win32':
cmd = '"%s"' % cmd # work around spawn lamosity on windows
ws = pkg_resources.working_set
assert os.spawnle(
os.P_WAIT, sys.executable, sys.executable,
'-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
dict(os.environ,
PYTHONPATH=
ws.find(pkg_resources.Requirement.parse('setuptools')).location
),
) == 0
ws.add_entry(tmpeggs)
ws.require('zc.buildout')
import zc.buildout.buildout
zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
shutil.rmtree(tmpeggs)
zope.app.server-3.6.0/setup.cfg 0000644 0001771 0002004 00000000073 11542403754 016273 0 ustar menesis menesis [egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0
zope.app.server-3.6.0/src/ 0000755 0001771 0002004 00000000000 11542403754 015241 5 ustar menesis menesis zope.app.server-3.6.0/src/zope.app.server.egg-info/ 0000755 0001771 0002004 00000000000 11542403754 021774 5 ustar menesis menesis zope.app.server-3.6.0/src/zope.app.server.egg-info/PKG-INFO 0000644 0001771 0002004 00000003772 11542403753 023101 0 ustar menesis menesis Metadata-Version: 1.0
Name: zope.app.server
Version: 3.6.0
Summary: ZServer integration for Zope 3 Applications
Home-page: http://cheeseshop.python.org/pypi/zope.app.server
Author: Zope Corporation and Contributors
Author-email: zope-dev@zope.org
License: ZPL 2.1
Description: This package integrates ZServer -- Zope's HTTP and FTP server -- into a Zope 3
application setup. It also defines the script skeleton for a classic Zope 3
application.
=======
CHANGES
=======
3.6.0 (2011-03-23)
------------------
- Moved ``zope.app.server.zpasswd`` to ``zope.password.zpasswd``.
3.5.0 (2009-12-19)
------------------
- Use ``zope.password`` instead of ``zope.app.authentication``
- Depend on new ``zope.processlifetime`` implementations instead of
using BBB imports from ``zope.app.appsetup``.
3.4.2 (2008-08-18)
------------------
- Moved a doctest into a unittest to fix failures in the KGS test suite
(see LP #257954)
3.4.1 (2008-02-25)
------------------
- Fixed restart so that the process exits with a non-zero exit status
so it gets restarted by zdaemon, or an equivalent mechanism.
- Removed the use of ``ThreadedAsync``.
3.4.0 (2007-10-27)
------------------
- Initial release independent of the main Zope tree.
Keywords: zope3 zserver server http ftp wsgi
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Zope Public License
Classifier: Programming Language :: Python
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Framework :: Zope3
zope.app.server-3.6.0/src/zope.app.server.egg-info/top_level.txt 0000644 0001771 0002004 00000000005 11542403753 024520 0 ustar menesis menesis zope
zope.app.server-3.6.0/src/zope.app.server.egg-info/SOURCES.txt 0000644 0001771 0002004 00000002453 11542403753 023663 0 ustar menesis menesis CHANGES.txt
COPYRIGHT.txt
LICENSE.txt
README.txt
bootstrap.py
buildout.cfg
setup.py
src/zope/__init__.py
src/zope.app.server.egg-info/PKG-INFO
src/zope.app.server.egg-info/SOURCES.txt
src/zope.app.server.egg-info/dependency_links.txt
src/zope.app.server.egg-info/namespace_packages.txt
src/zope.app.server.egg-info/not-zip-safe
src/zope.app.server.egg-info/requires.txt
src/zope.app.server.egg-info/top_level.txt
src/zope/app/__init__.py
src/zope/app/server/__init__.py
src/zope/app/server/accesslog.py
src/zope/app/server/accesslog.xml
src/zope/app/server/configure.zcml
src/zope/app/server/ftp.py
src/zope/app/server/main.py
src/zope/app/server/mkzopeinstance.py
src/zope/app/server/schema.xml
src/zope/app/server/server.py
src/zope/app/server/servercontrol.py
src/zope/app/server/servertype.py
src/zope/app/server/wsgi.py
src/zope/app/server/zpasswd.py
src/zope/app/server/tests/__init__.py
src/zope/app/server/tests/site.zcml
src/zope/app/server/tests/test_accesslog.py
src/zope/app/server/tests/test_ftp.py
src/zope/app/server/tests/test_mkzopeinstance.py
src/zope/app/server/tests/test_schema.py
src/zope/app/server/tests/test_server.py
src/zope/app/server/tests/test_servertype.py
src/zope/app/server/zopeskel/bin/debugzope.in
src/zope/app/server/zopeskel/bin/runzope.in
src/zope/app/server/zopeskel/etc/zope.conf.in zope.app.server-3.6.0/src/zope.app.server.egg-info/namespace_packages.txt 0000644 0001771 0002004 00000000016 11542403753 026323 0 ustar menesis menesis zope
zope.app
zope.app.server-3.6.0/src/zope.app.server.egg-info/not-zip-safe 0000644 0001771 0002004 00000000001 11542403743 024220 0 ustar menesis menesis
zope.app.server-3.6.0/src/zope.app.server.egg-info/dependency_links.txt 0000644 0001771 0002004 00000000001 11542403753 026041 0 ustar menesis menesis
zope.app.server-3.6.0/src/zope.app.server.egg-info/requires.txt 0000644 0001771 0002004 00000000425 11542403753 024374 0 ustar menesis menesis setuptools
zope.app.applicationcontrol
zope.app.appsetup >= 3.11
zope.app.publication
zope.app.wsgi
zope.configuration
zope.deprecation
zope.event
zope.interface
zope.publisher
zope.server
zope.password >= 3.6
zope.processlifetime
zdaemon
ZConfig
ZODB3
[test]
zope.app.testing zope.app.server-3.6.0/src/zope/ 0000755 0001771 0002004 00000000000 11542403754 016216 5 ustar menesis menesis zope.app.server-3.6.0/src/zope/__init__.py 0000644 0001771 0002004 00000000310 11542403742 020316 0 ustar menesis menesis # this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
zope.app.server-3.6.0/src/zope/app/ 0000755 0001771 0002004 00000000000 11542403754 016776 5 ustar menesis menesis zope.app.server-3.6.0/src/zope/app/__init__.py 0000644 0001771 0002004 00000000310 11542403742 021076 0 ustar menesis menesis # this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
zope.app.server-3.6.0/src/zope/app/server/ 0000755 0001771 0002004 00000000000 11542403754 020304 5 ustar menesis menesis zope.app.server-3.6.0/src/zope/app/server/servertype.py 0000644 0001771 0002004 00000004123 11542403742 023063 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Server Type
"""
from zope.interface import Interface, implements
class IServerType(Interface):
"""Server type utility.
This is a pure read-only interface, since the values are set through
a ZCML directive and we shouldn't be able to change them.
"""
def create(name, task_dispatcher, db, port=None, verbose=None, ip=None):
"""Create the server knowing the port, task dispatcher and the ZODB.
Returns the new server.
"""
class ServerType(object):
implements(IServerType)
def __init__(self, factory, requestFactory, logFactory,
defaultPort, defaultVerbose, defaultIP=''):
self._factory = factory
self._requestFactory = requestFactory
self._logFactory = logFactory
self._defaultPort = defaultPort
self._defaultVerbose = defaultVerbose
self._defaultIP = defaultIP
def create(self, name, task_dispatcher, db, port=None,
verbose=None, ip=None):
'See IServerType'
request_factory = self._requestFactory(db)
if port is None:
port = self._defaultPort
if ip is None:
ip = self._defaultIP
if verbose is None:
verbose = self._defaultVerbose
return self._factory(request_factory, name, ip, port,
task_dispatcher=task_dispatcher,
verbose=verbose,
hit_log=self._logFactory(),
)
zope.app.server-3.6.0/src/zope/app/server/accesslog.xml 0000644 0001771 0002004 00000001047 11542403742 022770 0 ustar menesis menesis
Configuration for the access logger.
Note that the setting of verbosity level and message formats are not
used. All logging is done using the Common Log Format.
zope.app.server-3.6.0/src/zope/app/server/__init__.py 0000644 0001771 0002004 00000000027 11542403742 022411 0 ustar menesis menesis # Make this a package.
zope.app.server-3.6.0/src/zope/app/server/wsgi.py 0000644 0001771 0002004 00000004744 11542403742 021635 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2005 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""WSGI-compliant HTTP server setup.
"""
__docformat__ = "reStructuredText"
import zope.interface
from zope.server.http.commonaccesslogger import CommonAccessLogger
from zope.server.http import wsgihttpserver
from zope.app.publication.httpfactory import HTTPPublicationRequestFactory
from zope.app.wsgi import WSGIPublisherApplication
import servertype
class ServerType(object):
zope.interface.implements(servertype.IServerType)
def __init__(self, factory, applicationFactory, logFactory,
defaultPort, defaultVerbose, defaultIP='',
requestFactory=HTTPPublicationRequestFactory):
self._factory = factory
self._applicationFactory = applicationFactory
self._requestFactory = requestFactory
self._logFactory = logFactory
self._defaultPort = defaultPort
self._defaultVerbose = defaultVerbose
self._defaultIP = defaultIP
def create(self, name, task_dispatcher, db, port=None,
verbose=None, ip=None):
'See IServerType'
application = self._applicationFactory(
db, factory=self._requestFactory)
if port is None:
port = self._defaultPort
if ip is None:
ip = self._defaultIP
if verbose is None:
verbose = self._defaultVerbose
return self._factory(application, name, ip, port,
task_dispatcher=task_dispatcher,
verbose=verbose,
hit_log=self._logFactory(),
)
http = ServerType(wsgihttpserver.WSGIHTTPServer,
WSGIPublisherApplication,
CommonAccessLogger,
8080, True)
pmhttp = ServerType(wsgihttpserver.PMDBWSGIHTTPServer,
WSGIPublisherApplication,
CommonAccessLogger,
8013, True)
zope.app.server-3.6.0/src/zope/app/server/server.py 0000644 0001771 0002004 00000003221 11542403742 022157 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Datatype for a section in a Zope 3 configuration file.
This is called by the ZConfig machinery while processing a configuration.
"""
import zope.component
from zope.app.server.servertype import IServerType
class ServerFactory(object):
"""Factory for server objects.
The factories are part of the configuration data returned by
ZConfig.
"""
def __init__(self, section):
"""Initialize the factory based on a section."""
self.type = section.type
self.address = section.address
self.verbose = section.verbose
def create(self, task_dispatcher, database):
"""Return a server based on the server types defined via ZCML."""
servertype = zope.component.getUtility(IServerType, self.type)
# The server object self-registers with the asyncore mainloop.
return servertype.create(
self.type,
task_dispatcher, database,
ip=self.address[0],
port=self.address[1],
verbose=self.verbose)
zope.app.server-3.6.0/src/zope/app/server/main.py 0000644 0001771 0002004 00000007300 11542403742 021577 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Functions that control how the Zope appserver knits itself together.
"""
import asyncore
import logging
import os
import sys
import time
from zdaemon import zdoptions
import zope.app.appsetup.appsetup
import zope.processlifetime
import zope.app.appsetup.product
from zope.event import notify
from zope.server.taskthreads import ThreadedTaskDispatcher
CONFIG_FILENAME = "zope.conf"
class ZopeOptions(zdoptions.ZDOptions):
logsectionname = None
def default_configfile(self):
dir = os.path.normpath(
os.path.join(os.path.dirname(__file__),
os.pardir, os.pardir, os.pardir, os.pardir))
for filename in [CONFIG_FILENAME, CONFIG_FILENAME + ".in"]:
filename = os.path.join(dir, filename)
if os.path.isfile(filename):
return filename
return None
exit_status = None
def main(args=None):
# Record start times (real time and CPU time)
t0 = time.time()
c0 = time.clock()
setup(load_options(args))
t1 = time.time()
c1 = time.clock()
logging.info("Startup time: %.3f sec real, %.3f sec CPU", t1-t0, c1-c0)
run()
sys.exit(exit_status or 0)
def debug(args=None):
options = load_options(args)
zope.app.appsetup.product.setProductConfigurations(
options.product_config)
zope.app.appsetup.config(options.site_definition)
db = zope.app.appsetup.appsetup.multi_database(options.databases)[0][0]
notify(zope.processlifetime.DatabaseOpened(db))
return db
def run():
try:
global exit_status
while asyncore.socket_map and exit_status is None:
asyncore.poll(30.0)
except KeyboardInterrupt:
# Exit without spewing an exception.
pass
def load_options(args=None):
if args is None:
args = sys.argv[1:]
options = ZopeOptions()
options.schemadir = os.path.dirname(os.path.abspath(__file__))
options.realize(args)
options = options.configroot
if options.path:
sys.path[:0] = [os.path.abspath(p) for p in options.path]
return options
def setup(options):
sys.setcheckinterval(options.check_interval)
zope.app.appsetup.product.setProductConfigurations(
options.product_config)
options.eventlog()
options.accesslog()
for logger in options.loggers:
logger()
features = ('zserver',)
# Provide the devmode, if activated
if options.devmode:
features += ('devmode',)
logging.warning("Developer mode is enabled: this is a security risk "
"and should NOT be enabled on production servers. Developer mode "
"can be turned off in etc/zope.conf")
zope.app.appsetup.config(options.site_definition, features=features)
db = zope.app.appsetup.appsetup.multi_database(options.databases)[0][0]
notify(zope.processlifetime.DatabaseOpened(db))
task_dispatcher = ThreadedTaskDispatcher()
task_dispatcher.setThreadCount(options.threads)
for server in options.servers:
server.create(task_dispatcher, db)
notify(zope.processlifetime.ProcessStarting())
return db
zope.app.server-3.6.0/src/zope/app/server/zpasswd.py 0000644 0001771 0002004 00000001412 11542403742 022344 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Implementation of the zpasswd script.
"""
import zope.deprecation
zope.deprecation.moved('zope.password.zpasswd', 'zope.app.server 3.7.0')
zope.app.server-3.6.0/src/zope/app/server/mkzopeinstance.py 0000644 0001771 0002004 00000031311 11542403742 023704 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Implementation of the mkzopeinstance script.
This creates a new instances of the Zope server instance home. An
'instance home' contains two things:
- application server configuration and data
- server process control scripts and data
"""
import optparse
import os
import shutil
import sys
from xml.sax.saxutils import quoteattr as xml_quoteattr
import zope.app.server
from zope.password import password
from zope.app.applicationcontrol import zopeversion
def main(argv=None, from_checkout=False):
"""Top-level script function to create a new Zope instance."""
if argv is None:
argv = sys.argv
try:
options = parse_args(argv, from_checkout)
except SystemExit, e:
if e.code:
return 2
else:
return 0
app = Application(options)
try:
return app.process()
except KeyboardInterrupt:
return 1
except SystemExit, e:
return e.code
class Application(object):
def __init__(self, options):
self.options = options
self.need_blank_line = False
def read_input_line(self, prompt):
# The tests replace this to make sure the right things happen.
if not self.options.interactive:
print >>sys.stderr, ('Error: Tried to ask for user input in'
' non-interactive mode.')
sys.exit(1)
return raw_input(prompt)
def read_password(self, prompt):
# The tests replace this to make sure the right things happen.
if not self.options.interactive:
print >>sys.stderr, ('Error: Tried to ask for user input in'
' non-interactive mode.')
sys.exit(1)
import getpass
try:
return getpass.getpass(prompt)
except KeyboardInterrupt:
# The cursor was left on the same line as the prompt,
# which we don't like. Print a blank line.
print
raise
def process(self):
options = self.options
# make sure we can find the skeleton
if not os.path.isdir(options.skeleton):
print >>sys.stderr, "skeleton directory", options.skeleton
print >>sys.stderr, "does not exist or is not a directory"
return 1
# create the destination
if not options.destination:
options.destination = self.get_skeltarget()
options.destination = os.path.abspath(options.destination)
if not os.path.exists(options.destination):
try:
os.mkdir(options.destination)
except OSError, e:
print >>sys.stderr, "could not create instance home:", e
return 1
elif not os.path.isdir(options.destination):
print >>sys.stderr, options.destination, "is not a directory"
print >>sys.stderr, ("(instance homes cannot be created in"
" non-directories)")
return 1
if not options.username:
options.username = self.get_username()
(options.password_manager,
password_manager) = self.get_password_manager()
if not options.password:
options.password = self.get_password()
options.password = password_manager.encodePassword(options.password)
# now create the instance!
self.copy_skeleton()
if options.add_package_includes:
# need to copy ZCML differently since it's not in the skeleton:
import __main__
swhome = os.path.dirname(
os.path.dirname(os.path.realpath(__main__.__file__)))
shutil.copy2(os.path.join(swhome, "securitypolicy.zcml"),
os.path.join(options.destination, "etc"))
return 0
def get_skeltarget(self):
self.print_message(SKELTARGET_MESSAGE)
self.need_blank_line = True
while 1:
skeltarget = self.read_input_line("Directory: ").strip()
if skeltarget == '':
print >>sys.stderr, 'You must specify a directory'
continue
return os.path.expanduser(skeltarget)
def get_username(self):
self.print_message(USERNAME_MESSAGE)
self.need_blank_line = True
while 1:
username = self.read_input_line("Username: ").strip()
if not username:
print >>sys.stderr, "You must specify an administrative user"
continue
return username
def get_password(self):
self.print_message(PASSWORD_MESSAGE)
while 1:
password = self.read_password("Password: ")
if not password:
print >>sys.stderr, "Password may not be empty"
continue
if password != password.strip() or password.split() != [password]:
print >>sys.stderr, "Password may not contain spaces"
continue
break
again = self.read_password("Verify password: ")
if again != password:
print >>sys.stderr, "Password not verified!"
sys.exit(1)
return password
def get_password_manager(self):
if not self.options.password_manager and not self.options.interactive:
self.options.password_manager = password.managers[0][0]
if self.options.password_manager:
for name, manager in password.managers:
if name == self.options.password_manager:
return (name, manager)
print >>sys.stderr, "Unknown password manager!"
sys.exit(1)
self.print_message(PASSWORD_MANAGER_MESSAGE)
for i, (name, manager) in enumerate(password.managers):
print "% i. %s" % (i + 1, name)
print
self.need_blank_line = True
while 1:
password_manager = self.read_input_line(
"Password Manager Number [1]: ")
if not password_manager:
index = 0
break
elif password_manager.isdigit():
index = int(password_manager)
if index > 0 and index <= len(password.managers):
index -= 1
break
print >>sys.stderr, "You must select a password manager"
print "%r password manager selected" % password.managers[index][0]
return password.managers[index]
def print_message(self, message):
if self.need_blank_line:
print
self.need_blank_line = False
print message
def copy_skeleton(self):
options = self.options
# TODO we should be able to compute the script
script = os.path.abspath(sys.argv[0])
zope_home = os.path.dirname(os.path.dirname(script))
zope_init = os.path.dirname(os.path.abspath(zope.app.__file__))
software_home = os.path.dirname(os.path.dirname(zope_init))
self.replacements = [
("<>", options.username),
("<>", xml_quoteattr(options.username)),
("<>", options.password),
("<>", xml_quoteattr(options.password)),
("<>", options.password_manager),
("<>", sys.executable),
("<>", options.destination),
("<>", zope_home),
("<>", software_home),
]
self.copytree(self.options.skeleton, self.options.destination)
if options.zserver:
self.copytree(
os.path.join(os.path.dirname(zope.app.server.__file__),
'zopeskel'),
self.options.destination,
)
def copytree(self, src, dst):
# Similar to shutil.copytree(), but doesn't care about
# symlinks, doesn't collect errors, and uses self.copyfile()
# instead of shutil.copy2().
assert os.path.isdir(dst), dst
names = os.listdir(src)
if ".svn" in names:
names.remove(".svn")
for name in names:
srcname = os.path.join(src, name)
dstname = os.path.join(dst, name)
if os.path.isdir(srcname):
if not os.path.exists(dstname):
os.mkdir(dstname)
self.copytree(srcname, dstname)
else:
self.copyfile(srcname, dstname)
# There shouldn't be any need to deal with devices, sockets etc.
def copyfile(self, src, dst):
if dst.endswith(".in"):
dst = dst[:-3]
text = open(src, "rU").read()
# perform replacements
for var, string in self.replacements:
text = text.replace(var, string)
# If the file exists, keep the old file. This is a
# hopefully temporary hack to get around distutils
# stripping the permissions on the server skeletin files.
# We reuse the original default files, which have the
# right permissions.
old = os.path.exists(dst)
if old:
f = open(dst, "r+")
f.truncate(0)
else:
f = open(dst, "w")
f.write(text)
f.close()
if not old:
shutil.copymode(src, dst)
shutil.copystat(src, dst)
else:
shutil.copy2(src, dst)
SKELTARGET_MESSAGE = """\
Please choose a directory in which you'd like to install Zope
'instance home' files such as database files, configuration files,
etc.
"""
USERNAME_MESSAGE = """\
Please choose a username for the initial administrator account.
This is required to allow Zope's management interface to be used.
"""
PASSWORD_MESSAGE = """\
Please provide a password for the initial administrator account.
"""
PASSWORD_MANAGER_MESSAGE = """\
Please select a password manager which will be used for encode the password of
the initial administrator account.
"""
def parse_args(argv, from_checkout=False):
"""Parse the command line, returning an object representing the input."""
path, prog = os.path.split(os.path.realpath(argv[0]))
version = "%prog for " + zopeversion.ZopeVersionUtility.getZopeVersion()
p = optparse.OptionParser(prog=prog,
usage="%prog [options]",
version=version)
p.add_option("-d", "--dir", dest="destination", metavar="DIR",
help="the dir in which the instance home should be created")
p.add_option("-s", "--skelsrc", dest="skeleton", metavar="DIR",
help="template skeleton directory")
p.add_option("-m", "--password-manager",
dest="password_manager", metavar="NAME",
help=("set the name of the password manager"
" to be used for encode the password"))
p.add_option("-u", "--user", dest="username", metavar="USER:PASSWORD",
help="set the user name and password of the initial user")
p.add_option("--non-interactive", dest="interactive", action="store_false",
default=True, help="do no interactive prompting")
p.add_option("--zserver", dest="zserver", action="store_true",
help="""\
Use the older ZServer network server rather than the default Twisted
server. The Twisted integration with Zope is experimental and not
recommended for use in production sites. We do encourage it's
use in development or in sites that can stand a little uncertianty, so
that we can gain more experience with it.
""",
)
options, args = p.parse_args(argv[1:])
if options.skeleton is None:
options.add_package_includes = from_checkout
basedir = os.path.dirname(path)
# no assurance that this exists!
options.skeleton = os.path.join(basedir, "zopeskel")
else:
options.add_package_includes = False
options.program = prog
options.version = version
if args:
p.error("too many arguments")
options.password = None
if options.username and ":" in options.username:
options.username, options.password = options.username.split(":", 1)
return options
zope.app.server-3.6.0/src/zope/app/server/ftp.py 0000644 0001771 0002004 00000003662 11542403742 021453 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""FTP server
"""
from zope.app.publication.ftp import FTPPublication
from zope.app.publication.interfaces import IPublicationRequestFactory
from zope.publisher.ftp import FTPRequest
from zope.server.ftp.logger import CommonFTPActivityLogger
from zope.server.ftp.publisher import PublisherFTPServer
from zope.app.server.servertype import ServerType
import zope.interface
class FTPRequestFactory(object):
"""FTP Request factory
FTP request factories for a given database create FTP requests with
publications on the given database:
.. The test below has been disabled and moved to test_ftp.py (LP #257954)
>>> from ZODB.tests.util import DB
>>> db = DB()
>>> factory = FTPRequestFactory(db)
>>> from cStringIO import StringIO
>>> request = factory(StringIO(''), {'credentials': None, 'path': '/'})
>>> request.publication.db is db
True
>>> db.close()
"""
zope.interface.implements(IPublicationRequestFactory)
def __init__(self, db):
self.publication = FTPPublication(db)
def __call__(self, input_stream, env):
request = FTPRequest(input_stream, env)
request.setPublication(self.publication)
return request
server = ServerType(
PublisherFTPServer,
FTPRequestFactory,
CommonFTPActivityLogger,
8021, True)
zope.app.server-3.6.0/src/zope/app/server/servercontrol.py 0000644 0001771 0002004 00000003131 11542403742 023560 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2001,2002,2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Server Control Implementation
"""
from zope.app.applicationcontrol.interfaces import IServerControl
from zope.interface import implements
import zope.app.server.main
class ServerControl(object):
implements(IServerControl)
def shutdown(self, time=0):
"""See zope.app.applicationcontrol.interfaces.IServerControl"""
# TODO: Graceful shutdown does not work yet.
# This will work for servers started directly and by zdaemon. Passing
# an exit status of 0 causes zdaemon to not restart the process.
zope.app.server.main.exit_status = 0
def restart(self, time=0):
"""See zope.app.applicationcontrol.interfaces.IServerControl"""
# TODO: Graceful restart does not work yet.
# TODO: Make sure this is only called if we are running via zdaemon.
# Passing an exit status of 1 causes zdaemon to restart the process.
zope.app.server.main.exit_status = 1
serverControl = ServerControl()
zope.app.server-3.6.0/src/zope/app/server/configure.zcml 0000644 0001771 0002004 00000001204 11542403742 023146 0 ustar menesis menesis
zope.app.server-3.6.0/src/zope/app/server/accesslog.py 0000644 0001771 0002004 00000002425 11542403742 022621 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Configuration support for the access log.
This assumes that access logging is being performed through the logger
object returned by logging.getLogger('accesslog').
"""
import logging
from ZConfig.components.logger.logger import LoggerFactoryBase
class AccessLogFactory(LoggerFactoryBase):
"""Logger factory that returns the access logger."""
name = "accesslog"
def create(self):
logger = LoggerFactoryBase.create(self)
logger.setLevel(logging.INFO)
logger.propagate = False
formatter = logging.Formatter()
for handler in logger.handlers:
handler.setFormatter(formatter)
return logger
zope.app.server-3.6.0/src/zope/app/server/tests/ 0000755 0001771 0002004 00000000000 11542403754 021446 5 ustar menesis menesis zope.app.server-3.6.0/src/zope/app/server/tests/test_schema.py 0000644 0001771 0002004 00000002275 11542403742 024322 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Test that the Zope appserver configuration schema can be loaded.
"""
import os.path
import unittest
import ZConfig
class TestConfiguration(unittest.TestCase):
def test_schema(self):
dir = os.path.dirname(os.path.dirname(__file__))
filename = os.path.join(dir, "schema.xml")
ZConfig.loadSchema(filename)
def test_suite():
return unittest.makeSuite(TestConfiguration)
if __name__ == "__main__":
try:
__file__
except NameError:
import sys
__file__ = sys.argv[0]
unittest.main(defaultTest="test_suite")
zope.app.server-3.6.0/src/zope/app/server/tests/__init__.py 0000644 0001771 0002004 00000000027 11542403742 023553 0 ustar menesis menesis # Make this a package.
zope.app.server-3.6.0/src/zope/app/server/tests/test_mkzopeinstance.py 0000644 0001771 0002004 00000035354 11542403742 026120 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Tests for the implementation of the mkzopeinstance script.
"""
import os
import shutil
import sys
import tempfile
import unittest
import zope.app.server
from StringIO import StringIO
from zope.app.server import mkzopeinstance
class TestBase(unittest.TestCase):
def setUp(self):
self.stdout = StringIO()
self.stderr = StringIO()
self.old_stdout = sys.stdout
self.old_stderr = sys.stderr
sys.stdout = self.stdout
sys.stderr = self.stderr
def tearDown(self):
sys.stdout = self.old_stdout
sys.stderr = self.old_stderr
class ArgumentParsingTestCase(TestBase):
"""Ensure the command line is properly converted to an options
object.
"""
def parse_args(self, args):
argv = ["foo/bar.py"] + args
options = mkzopeinstance.parse_args(argv)
self.assertEqual(options.program, "bar.py")
self.assert_(options.version)
return options
def test_no_arguments(self):
options = self.parse_args([])
def test_version_long(self):
self.check_stdout_content(["--version"])
def test_help_long(self):
self.check_stdout_content(["--help"])
def test_help_short(self):
self.check_stdout_content(["-h"])
def check_stdout_content(self, args):
try:
options = self.parse_args(args)
except SystemExit, e:
self.assertEqual(e.code, 0)
self.assert_(self.stdout.getvalue())
self.failIf(self.stderr.getvalue())
else:
self.fail("expected SystemExit")
def test_without_destination(self):
options = self.parse_args([])
self.assertEqual(options.destination, None)
def test_destination_long(self):
options = self.parse_args(["--dir", "some/dir"])
self.assertEqual(options.destination, "some/dir")
def test_destination_short(self):
options = self.parse_args(["-d", "some/dir"])
self.assertEqual(options.destination, "some/dir")
def test_without_skeleton(self):
# make sure we get *some* skeleton directory by default
# there's no claim that it exists
options = self.parse_args([])
self.assertNotEqual(options.skeleton, None)
def test_with_skeleton_long(self):
options = self.parse_args(["--skelsrc", "some/dir"])
self.assertEqual(options.skeleton, "some/dir")
self.failIf(options.add_package_includes)
def test_with_skeleton_short(self):
options = self.parse_args(["-s", "some/dir"])
self.assertEqual(options.skeleton, "some/dir")
self.failIf(options.add_package_includes)
def test_without_username(self):
options = self.parse_args([])
self.assertEqual(options.username, None)
self.assertEqual(options.password, None)
def test_username_without_password_long(self):
options = self.parse_args(["--user", "User"])
self.assertEqual(options.username, "User")
self.assertEqual(options.password, None)
def test_username_without_password_short(self):
options = self.parse_args(["-u", "User"])
self.assertEqual(options.username, "User")
self.assertEqual(options.password, None)
def test_username_with_password_long(self):
options = self.parse_args(["--user", "User:Pass"])
self.assertEqual(options.username, "User")
self.assertEqual(options.password, "Pass")
def test_username_with_password_short(self):
options = self.parse_args(["-u", "User:Pass"])
self.assertEqual(options.username, "User")
self.assertEqual(options.password, "Pass")
def test_without_password_manager(self):
options = self.parse_args([])
self.assertEqual(options.password_manager, None)
def test_password_manager_short(self):
options = self.parse_args(["-m", "Manager"])
self.assertEqual(options.password_manager, "Manager")
def test_password_manager_long(self):
options = self.parse_args(["--password-manager", "Manager"])
self.assertEqual(options.password_manager, "Manager")
def test_junk_positional_arg(self):
try:
self.parse_args(["junk"])
except SystemExit, e:
self.assert_(e.code)
else:
self.fail("expected SystemExit")
class InputCollectionTestCase(TestBase):
def setUp(self):
super(InputCollectionTestCase, self).setUp()
self.tmpdir = tempfile.mkdtemp(prefix="test-mkzopeinstance-")
self.skeleton = os.path.join(self.tmpdir, "skel")
self.instance = os.path.join(self.tmpdir, "inst")
os.mkdir(self.skeleton)
def tearDown(self):
shutil.rmtree(self.tmpdir)
super(InputCollectionTestCase, self).tearDown()
def createOptions(self):
options = Options()
options.skeleton = self.skeleton
options.interactive = True
return options
def test_get_skeltarget(self):
options = self.createOptions()
input = [" ", " foo "]
app = ControlledInputApplication(options, input)
skel = app.get_skeltarget()
self.assertEqual(skel, "foo")
self.assertEqual(input, [])
self.assert_(self.stdout.getvalue())
self.failUnless(app.all_input_consumed())
def test_process_creates_destination(self):
options = self.createOptions()
input = [self.instance]
app = ControlledInputApplication(options, input)
self.assertEqual(app.process(), 0)
self.assert_(os.path.isdir(self.instance))
self.assertEqual(input, [])
self.failUnless(app.all_input_consumed())
def test_zserver_support(self):
# test the zserver option. We should get zserver versions of
# runzope, zopectl, debugzope and zope.conf. Any of these
# that we provide in put skeleton should be overritten.
# privide a dummy runzope
os.mkdir(os.path.join(self.skeleton, 'bin'))
f = open(os.path.join(self.skeleton, 'bin', 'runzope.in'), 'w')
f.write('runzope')
f.close()
options = self.createOptions()
options.destination = self.instance
options.interactive = False
options.zserver = True
app = ControlledInputApplication(options, [])
self.assertEqual(app.process(), 0)
self.assert_(
'from zope.app.server.main import main' in
open(os.path.join(self.instance, 'bin', 'runzope')).read()
)
self.assert_(
'from zope.app.server.main import debug' in
open(os.path.join(self.instance, 'bin', 'debugzope')).read()
)
self.assert_(os.path.exists(
os.path.join(self.instance, 'etc', 'zope.conf')
))
def test_process_aborts_on_file_destination(self):
options = self.createOptions()
options.destination = self.instance
open(self.instance, "w").close()
app = ControlledInputApplication(options, [])
self.assertEqual(app.process(), 1)
self.assert_(self.stderr.getvalue())
def test_process_aborts_on_failed_destination_creation(self):
options = self.createOptions()
options.destination = os.path.join(self.instance, "foo")
app = ControlledInputApplication(options, [])
self.assertEqual(app.process(), 1)
self.assert_(self.stderr.getvalue())
def test_get_username(self):
options = self.createOptions()
app = ControlledInputApplication(options, ["myuser"])
usr = app.get_username()
self.assertEqual(usr, "myuser")
self.failIf(self.stderr.getvalue())
self.failUnless(self.stdout.getvalue())
self.failUnless(app.all_input_consumed())
def test_get_username_strips_whitespace(self):
options = self.createOptions()
app = ControlledInputApplication(options, [" myuser\t"])
usr = app.get_username()
self.assertEqual(usr, "myuser")
self.failIf(self.stderr.getvalue())
self.failUnless(self.stdout.getvalue())
self.failUnless(app.all_input_consumed())
def test_get_username_ignores_empty_names(self):
options = self.createOptions()
app = ControlledInputApplication(options, ["", " ", "\t", "myuser"])
usr = app.get_username()
self.assertEqual(usr, "myuser")
self.failUnless(self.stderr.getvalue())
self.failUnless(self.stdout.getvalue())
self.failUnless(app.all_input_consumed())
def test_get_password_manager(self):
options = self.createOptions()
options.password_manager = None
app = ControlledInputApplication(options, ["1"])
name, pwm = app.get_password_manager()
self.assertEqual(name, "Plain Text")
self.assertEqual(pwm.encodePassword("foo"), "foo")
self.failIf(self.stderr.getvalue())
self.failUnless(self.stdout.getvalue())
self.failUnless(app.all_input_consumed())
def test_get_wrong_password_manager(self):
options = self.createOptions()
options.password_manager = "Unknown"
app = ControlledInputApplication(options, [])
try:
app.get_password_manager()
except SystemExit, e:
self.assertEqual(e.code, 1)
else:
self.fail("expected SystemExit")
self.failUnless(self.stderr.getvalue())
self.failIf(self.stdout.getvalue())
self.failUnless(app.all_input_consumed())
def test_get_password(self):
options = self.createOptions()
app = ControlledInputApplication(options, ["foo", "foo"])
pw = app.get_password()
self.assertEqual(pw, "foo")
self.failIf(self.stderr.getvalue())
self.failUnless(self.stdout.getvalue())
self.failUnless(app.all_input_consumed())
def test_get_password_not_verified(self):
options = self.createOptions()
app = ControlledInputApplication(options, ["foo", "bar"])
try:
app.get_password()
except SystemExit, e:
self.assertEqual(e.code, 1)
else:
self.fail("expected SystemExit")
self.failUnless(self.stderr.getvalue())
self.failUnless(self.stdout.getvalue())
self.failUnless(app.all_input_consumed())
def test_get_password_empty(self):
# Make sure the empty password is ignored.
options = self.createOptions()
app = ControlledInputApplication(options, ["", "foo", "foo"])
pw = app.get_password()
self.assertEqual(pw, "foo")
self.failUnless(self.stderr.getvalue())
self.failUnless(self.stdout.getvalue())
self.failUnless(app.all_input_consumed())
def test_get_password_disallows_whitespace(self):
# Any password that contains spaces is disallowed.
options = self.createOptions()
app = ControlledInputApplication(options, [" ", "\t", "a b",
" a", "b ", "foo", "foo"])
pw = app.get_password()
self.assertEqual(pw, "foo")
self.failUnless(self.stderr.getvalue())
self.failUnless(self.stdout.getvalue())
self.failUnless(app.all_input_consumed())
def test_can_rewrite_existing_instance(self):
# Fill out the skeleton a little so we test more cases:
os.mkdir(os.path.join(self.skeleton, "etc"))
f = open(os.path.join(self.skeleton, "etc", "README.txt"), "w")
f.write("Configuration goes here.\n")
f.close()
# Create an instance home:
options = self.createOptions()
options.destination = self.instance
app = ControlledInputApplication(options, [])
rc = app.process()
self.assertEqual(rc, 0)
self.failUnless(app.all_input_consumed())
self.failUnless(os.path.exists(os.path.join(self.instance, "etc")))
# Make sure we can do it again:
options = self.createOptions()
options.destination = self.instance
app = ControlledInputApplication(options, [])
rc = app.process()
self.assertEqual(rc, 0)
self.failUnless(app.all_input_consumed())
self.failUnless(os.path.exists(os.path.join(self.instance, "etc")))
def test_zope_namespace_package_doesnt_affect_software_home(self):
# Make sure that a zope namespace package in a different
# location won't affect SOFTWARE_HOME
# let's mess with zope's __file__
import zope
old_path = zope.__file__
zope.__file__ = os.path.join(
*'and now for something completely different'.split())
# place a test file into the skeleton dir that'll be expanded
# to SOFTWARE_HOME by mkzopeinstance
f = file(os.path.join(self.skeleton, 'test.in'), 'w')
f.write('<>')
f.close()
# run mkzopeinstance
options = self.createOptions()
options.destination = self.instance
app = ControlledInputApplication(options, [])
rc = app.process()
# check for the expected output: mkzopeinstance should take
# zope.app as an anchor for determining SOFTWARE_HOME
import zope.app
expected = os.path.dirname(os.path.dirname(
os.path.dirname(zope.app.__file__)))
self.assertEqual(file(os.path.join(self.instance, 'test')).read(),
expected)
# cleanup the fake 'zope' module
zope.__file__ = old_path
class ControlledInputApplication(mkzopeinstance.Application):
def __init__(self, options, input_lines):
mkzopeinstance.Application.__init__(self, options)
self.__input = input_lines
def read_input_line(self, prompt):
return self.__input.pop(0)
read_password = read_input_line
def all_input_consumed(self):
return not self.__input
class Options(object):
username = "[test-username]"
password_manager = "Plain Text"
password = "[test-password]"
destination = None
version = "[test-version]"
program = "[test-program]"
add_package_includes = False
zserver = False
def test_suite():
suite = unittest.makeSuite(ArgumentParsingTestCase)
suite.addTest(unittest.makeSuite(InputCollectionTestCase))
return suite
if __name__ == "__main__":
unittest.main(defaultTest="test_suite")
zope.app.server-3.6.0/src/zope/app/server/tests/test_server.py 0000644 0001771 0002004 00000006412 11542403742 024365 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2005 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Tests for zope.app.server.server
"""
import unittest
import doctest
from zope.interface.verify import verifyObject
from zope.component import provideUtility
from zope.app.testing import setup
def doctest_ServerFactory():
r"""Tests for ServerFactory
Zope 3 has many server types -- HTTP, FTP, HTTP with postmortem debugging,
etc. All of them are registered as IServerType utilities in ZCML.
>>> setup.placelessSetUp()
>>> from zope.interface import implements
>>> from zope.app.server.servertype import IServerType
>>> class MyServerType:
... implements(IServerType)
... def create(self, name, task_dispatcher, db, port='unknown',
... verbose='unspecified', ip=''):
... if not ip:
... ip = '*' # listen on all interfaces
... return ('%s server on %s:%d, registered with %s,\n'
... 'serving from %s, verbosity %s'
... % (name, ip, port, task_dispatcher, db, verbose))
>>> provideUtility(MyServerType(), IServerType, name='HTTP')
>>> provideUtility(MyServerType(), IServerType, name='FTP')
ServerFactory is used to hook into ZConfig and create instances of servers
specified in zope.conf. It gets a `section` argument that contains
settings specified in a ZConfig section.
>>> class ServerSectionStub:
... type = 'HTTP'
... address = ('', 8080)
... verbose = False
>>> my_section = ServerSectionStub()
>>> from zope.app.server.server import ServerFactory
>>> sf = ServerFactory(my_section)
The server factory object knows how to create a server, given a task
dispatcher (see IDispatcher from zope.server.interfaces) and a ZODB
database object.
>>> task_dispatcher = 'my task dispatcher'
>>> db = 'my db'
>>> print sf.create(task_dispatcher, db)
HTTP server on *:8080, registered with my task dispatcher,
serving from my db, verbosity False
The settings actually work
>>> my_section.type = 'FTP'
>>> my_section.address = ('127.0.0.1', 8021)
>>> my_section.verbose = True
>>> sf = ServerFactory(my_section)
>>> print sf.create(task_dispatcher, db)
FTP server on 127.0.0.1:8021, registered with my task dispatcher,
serving from my db, verbosity True
That's it.
>>> setup.placelessTearDown()
"""
def test_suite():
return unittest.TestSuite((
doctest.DocTestSuite(),
))
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
zope.app.server-3.6.0/src/zope/app/server/tests/test_ftp.py 0000644 0001771 0002004 00000002360 11542403742 023646 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Doc tests for the FTP server.
"""
import unittest
class Tests(unittest.TestCase):
def test_ftp(self):
from ZODB.tests.util import DB
from zope.app.server.ftp import FTPRequestFactory
from cStringIO import StringIO
db = DB()
factory = FTPRequestFactory(db)
request = factory(StringIO(''), {'credentials': None, 'path': '/'})
self.assertTrue(request.publication.db is db)
db.close()
def test_suite():
loader = unittest.TestLoader()
return loader.loadTestsFromTestCase(Tests)
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
zope.app.server-3.6.0/src/zope/app/server/tests/site.zcml 0000644 0001771 0002004 00000000065 11542403742 023277 0 ustar menesis menesis
zope.app.server-3.6.0/src/zope/app/server/tests/test_accesslog.py 0000644 0001771 0002004 00000005316 11542403742 025024 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Tests for zope.app.server.accesslog.
"""
import logging
import unittest
from ZConfig.components.logger import loghandler
from ZConfig.components.logger.tests import test_logger
class TestAccessLogging(test_logger.LoggingTestBase):
name = "accesslog"
_schematext = """
"""
def test_config_without_logger(self):
conf = self.get_config("")
self.assert_(conf.accesslog is None)
def test_config_without_handlers(self):
logger = self.check_simple_logger("")
# Make sure there's a NullHandler, since a warning gets
# printed if there are no handlers:
self.assertEqual(len(logger.handlers), 1)
self.assert_(isinstance(logger.handlers[0],
loghandler.NullHandler))
def test_formatter(self):
logger = self.check_simple_logger("\n"
" \n"
" level error\n"
" facility local3\n"
" format xyzzy\n"
" \n"
"")
self.assertEqual(len(logger.handlers), 1)
syslog = logger.handlers[0]
self.assertEqual(syslog.level, logging.ERROR)
self.assert_(isinstance(syslog, loghandler.SysLogHandler))
self.assertEqual(syslog.formatter._fmt, "%(message)s")
def check_simple_logger(self, text):
conf = self.get_config(text)
self.assert_(conf.accesslog is not None)
logger = conf.accesslog()
self.assert_(isinstance(logger, logging.Logger))
self.assert_(not logger.propagate)
self.assertEquals(logger.name, "accesslog")
self.assertEquals(logger.level, logging.INFO)
return logger
def test_suite():
return unittest.makeSuite(TestAccessLogging)
zope.app.server-3.6.0/src/zope/app/server/tests/test_servertype.py 0000644 0001771 0002004 00000012161 11542403742 025265 0 ustar menesis menesis ##############################################################################
#
# Copyright (c) 2005 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Tests for zope.app.server.servertype
"""
import unittest
import doctest
from zope.interface.verify import verifyObject
def doctest_ServerType():
r"""Tests for ServerType
Zope 3 has many server types -- HTTP, FTP, HTTP with postmortem debugging,
etc. All of them are registered as IServerType utilities in ZCML.
ServerType is an implementation of IServerType. The constructor of
ServerType takes quite a few arguments, a number of which are factories.
We will use stubs of those.
The 'factory' argument specifies the server factory (e.g.
PublisherHTTPServer from zope.server.http.httpserver)
>>> def factory(request_factory, name, ip, port,
... task_dispatcher=None, hit_log=None, verbose=False):
... if ip == '':
... ip = '*' # listen on all network interfaces
... print "Starting a server (%s) on %s:%d" % (name, ip, port)
... print "This server will use %s to construct requests" % \
... request_factory
... print "This server will use %s for hit logging" % hit_log
... if verbose:
... print "This server will be verbose"
... else:
... print "This server will not be verbose"
... print "This server will be managed by %s" % task_dispatcher
The 'requestFactory' argument specifies a function that returns a factory
for requests (e.g. HTTPPublicationRequestFactory from
zope.server.http.publisherhttpserver). It is, in fact, a request factory
factory.
>>> def requestFactory(db):
... return 'my request factory for %s' % db
The 'logFactory' argument specifies the factory for an access logger (e.g.
CommonAccessLogger from zope.server.http.commonaccesslogger).
>>> def logFactory():
... return 'my logger'
The 'defaultPort' argument specifies the default TCP port number for the
server.
The 'defaultVerbose' argument specifies the default verbosity.
The 'defaultIP' argument specifies the network interface for listening on.
You can specify the network interface IP address, or an empty string if you
want to listen on all interfaces.
>>> from zope.app.server.servertype import IServerType
>>> from zope.app.server.servertype import ServerType
>>> st = ServerType(factory, requestFactory, logFactory,
... defaultPort=8080, defaultVerbose=False)
>>> verifyObject(IServerType, st)
True
A server type is then registered as a named utility. These utilities are
used while interpreting sections of zope.conf to create instances
of servers listening on a specific port.
When you create an instance of a server, you need to tell it the task
dispatcher (see IDispatcher in zope.server.interfaces), and the ZODB
database object.
The `name` argument to create is, as far as I can tell, purely informative.
It is used to construct a server identifier that appears in log files and,
for example, the 'Server' HTTP header.
>>> dispatcher = 'my task dispatcher'
>>> db = 'my database'
>>> st.create('Sample Server', dispatcher, db)
Starting a server (Sample Server) on *:8080
This server will use my request factory for my database to construct requests
This server will use my logger for hit logging
This server will not be verbose
This server will be managed by my task dispatcher
You can, of course, create multiple instances of the same server type, and
bind them to different ports.
>>> st.create('Sample Server 2', dispatcher, db, port=1234, verbose=True)
Starting a server (Sample Server 2) on *:1234
This server will use my request factory for my database to construct requests
This server will use my logger for hit logging
This server will be verbose
This server will be managed by my task dispatcher
>>> st.create('Sample Server 3', dispatcher, db, port=9090,
... ip='127.0.0.1')
Starting a server (Sample Server 3) on 127.0.0.1:9090
This server will use my request factory for my database to construct requests
This server will use my logger for hit logging
This server will not be verbose
This server will be managed by my task dispatcher
"""
def test_suite():
return doctest.DocTestSuite()
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
zope.app.server-3.6.0/src/zope/app/server/zopeskel/ 0000755 0001771 0002004 00000000000 11542403754 022140 5 ustar menesis menesis zope.app.server-3.6.0/src/zope/app/server/zopeskel/etc/ 0000755 0001771 0002004 00000000000 11542403754 022713 5 ustar menesis menesis zope.app.server-3.6.0/src/zope/app/server/zopeskel/etc/zope.conf.in 0000644 0001771 0002004 00000003671 11542403742 025150 0 ustar menesis menesis # This is the configuration file for the Zope Application Server.
%define INSTANCE <>
%define CONFDIR $INSTANCE/etc
%define DATADIR $INSTANCE/var
%define LOGDIR $INSTANCE/log
# identify the component configuration used to define the site:
#
site-definition $INSTANCE/etc/site.zcml
# number of bytecode instructions to execute between checks for
# interruptions (SIGINTR, thread switches):
#
interrupt-check-interval 200
type WSGI-HTTP
address 8080
# For debugging purposes, you can use this publisher instead/as well
# (obviously if it's as well, use a different port number). If there's
# an exception, Zope will drop into pdb at the point of the exception.
#
#
# type WSGI-PostmortemDebuggingHTTP
# address 8080
#
# uncomment this if you want the FTP server up and running
#
# type FTP
# address 8021
#
# Standard Filestorage
path $DATADIR/Data.fs
# uncomment this if you want to connect to a local ZEO server
# instead:
#
# server localhost:9999
# storage 1
# # ZEO client cache, in bytes
# cache-size 20MB
# # Uncomment to have a persistent disk cache
# #client zeo1
#
# This sets up logging to both a file (access.log) and to standard
# output (STDOUT). The "path" setting can be a relative or absolute
# filesystem path or the tokens STDOUT or STDERR.
path $LOGDIR/access.log
path STDOUT
# This sets up logging to both a file and to standard output
# (STDOUT). The "path" setting can be a relative or absolute
# filesystem path or the tokens STDOUT or STDERR.
path $LOGDIR/z3.log
path STDOUT
# devmode
#
# Switches the Developer Mode on and off.
#
# Default:
# devmode on
#
#devmode off
zope.app.server-3.6.0/src/zope/app/server/zopeskel/bin/ 0000755 0001771 0002004 00000000000 11542403754 022710 5 ustar menesis menesis zope.app.server-3.6.0/src/zope/app/server/zopeskel/bin/debugzope.in 0000755 0001771 0002004 00000003047 11542403742 025230 0 ustar menesis menesis #!<> -i
##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Script to run the Zope Application Server from the Python prompt.
"""
import os
import sys
SOFTWARE_HOME = r"<>"
INSTANCE_HOME = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
CONFIG_FILE = os.path.join(INSTANCE_HOME, "etc", "zope.conf")
def startup():
# This removes the script directory from sys.path, which we do
# since there are no modules here.
#
basepath = filter(None, sys.path)
sys.path[:] = [os.path.join(INSTANCE_HOME, "lib", "python"),
SOFTWARE_HOME] + basepath
from zope.app.server.main import debug
db = debug(["-C", CONFIG_FILE] + sys.argv[1:])
if "PYTHONSTARTUP" in os.environ:
execfile(os.environ["PYTHONSTARTUP"])
return db
if __name__ == '__main__':
db = startup()
del startup
from zope.app.debug import Debugger
debugger = app = Debugger.fromDatabase(db)
del db
del Debugger
zope.app.server-3.6.0/src/zope/app/server/zopeskel/bin/runzope.in 0000755 0001771 0002004 00000003000 11542403742 024733 0 ustar menesis menesis #!<>
##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
"""Script to run the Zope Application Server in the foreground.
"""
import os
import sys
SOFTWARE_HOME = r"<>"
INSTANCE_HOME = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
CONFIG_FILE = os.path.join(INSTANCE_HOME, "etc", "zope.conf")
def run():
if sys.version_info < ( 2,3,5 ):
print """\
ERROR: Your python version is not supported by Zope3.
Zope3 needs Python 2.3.5 or greater. You are running:""" + sys.version
sys.exit(1)
# This removes the script directory from sys.path, which we do
# since there are no modules here.
#
basepath = filter(None, sys.path)
sys.path[:] = [os.path.join(INSTANCE_HOME, "lib", "python"),
SOFTWARE_HOME] + basepath
from zope.app.server.main import main
main(["-C", CONFIG_FILE] + sys.argv[1:])
if __name__ == '__main__':
run()
zope.app.server-3.6.0/src/zope/app/server/schema.xml 0000644 0001771 0002004 00000003240 11542403742 022262 0 ustar menesis menesis
Configuration for the access log.
Value passed to Python's sys.setcheckinterval() function.
This integer value determines how often the interpreter checks
for periodic things such as thread switches and signal handlers.
Setting it to a larger value may increase performance for
programs using threads. Setting it to a value <= 0 checks every
virtual instruction, maximizing responsiveness as well as
overhead.
The number of threads which should be used to serve requests.
The threads are placed in a pool and are used to serve requests
received from the servers configured using <server>
sections. This does not constrain the total number of threads
used by the application server; additional threads may be used
for internal purposes.
zope.app.server-3.6.0/buildout.cfg 0000644 0001771 0002004 00000001324 11542403742 016757 0 ustar menesis menesis [buildout]
develop = .
parts = test zope
[test]
recipe = zc.recipe.testrunner
eggs = zope.app.server [test]
[app]
servers = zserver
recipe = zc.zope3recipes:application
eggs =
zope.app.zcmlfiles
zope.app.server
zope.app.securitypolicy
site.zcml =
[zope]
recipe = zc.zope3recipes:instance
application = app
zope.conf =