Skip to content

Commit ca89e19

Browse files
committed
import raw zope.server code
0 parents  commit ca89e19

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+8206
-0
lines changed

CHANGES.txt

+155
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
=======
2+
CHANGES
3+
=======
4+
5+
3.8.6 (unreleased)
6+
------------------
7+
8+
- Nothing changed yet.
9+
10+
11+
3.8.5 (2011-09-13)
12+
------------------
13+
14+
- fixed bug: requests lasting over 15 minutes were sometimes closed
15+
prematurely.
16+
17+
3.8.4 (2011-06-07)
18+
------------------
19+
20+
- Fix syntax error in tests on Python < 2.6.
21+
22+
23+
3.8.3 (2011-05-18)
24+
------------------
25+
26+
- Made ``start_response`` method of WSGI server implementation more compliant
27+
with spec:
28+
29+
http://www.python.org/dev/peps/pep-0333/#the-start-response-callable
30+
31+
3.8.2 (2010-12-04)
32+
------------------
33+
34+
- Corrected license version in ``zope/server/http/tests/test_wsgiserver.py``.
35+
36+
3.8.1 (2010-08-24)
37+
------------------
38+
39+
- When the result of a WSGI application was received, ``task.write()`` was
40+
only called once to transmit the data. This prohibited the transmission of
41+
partial results. Now the WSGI server iterates through the result itself
42+
making multiple ``task.write()`` calls, which will cause partial data to be
43+
transmitted.
44+
45+
- Created a second test case instance for the post-mortem WSGI server, so it
46+
is tested as well.
47+
48+
- Using python's ``doctest`` module instead of deprecated
49+
``zope.testing.doctest``.
50+
51+
3.8.0 (2010-08-05)
52+
------------------
53+
54+
- Implemented correct server proxy behavior. The HTTP server would always add
55+
a "Server" and "Date" response header to the list of response headers
56+
regardless whether one had been set already. The HTTP 1.1 spec specifies
57+
that a proxy server must not modify the "Server" and "Date" header but add a
58+
"Via" header instead.
59+
60+
3.7.0 (2010-08-01)
61+
------------------
62+
63+
- Implemented proxy support. Proxy requests contain a full URIs and the
64+
request parser used to throw that information away. Using
65+
``urlparse.urlsplit()``, all pieces of the URL are recorded.
66+
67+
- The proxy acheme and netloc/hostname are exposed in the WSGI environment as
68+
``zserver.proxy.scheme`` and ``zserver.proxy.host``.
69+
70+
- Made tests runnable via buildout again.
71+
72+
3.6.2 (2010-06-11)
73+
------------------
74+
75+
- The log message "Exception during task" is no longer logged to the root
76+
logger but to zope.server.taskthreads.
77+
78+
79+
3.6.1 (2009-10-07)
80+
------------------
81+
82+
- Made tests pass with current zope.publisher which restricts redirects to the
83+
current host by default.
84+
85+
86+
3.6.0 (2009-05-27)
87+
------------------
88+
89+
- Moved some imports from test modules to their setUp to prevent
90+
failures when ZEO tests are run by the same testrunner
91+
92+
- Removed unused dependency on zope.deprecation.
93+
94+
- Remove old zpkg-related DEPENDENCIES.cfg file.
95+
96+
97+
3.5.0 (2008-03-01)
98+
------------------
99+
100+
- Improve package meta-data.
101+
102+
- Fix of 599 error on conflict error in request
103+
see: http://mail.zope.org/pipermail/zope-dev/2008-January/030844.html
104+
105+
- Removed dependency on ZODB.
106+
107+
108+
3.5.0a2 (2007-06-02)
109+
--------------------
110+
111+
- Made WSGI server really WSGI-compliant by adding variables to the
112+
environment that are required by the spec.
113+
114+
115+
3.5.0a1 (2007-06-02)
116+
--------------------
117+
118+
- Added a factory and entry point for PasteDeploy.
119+
120+
121+
3.4.3 (2008-08-18)
122+
------------------
123+
124+
- Moved some imports from test modules to their setUp to prevent
125+
failures when ZEO tests are run by the same testrunner
126+
127+
128+
3.4.2 (2008-02-02)
129+
------------------
130+
131+
- Fix of 599 error on conflict error in request
132+
see: http://mail.zope.org/pipermail/zope-dev/2008-January/030844.html
133+
134+
135+
3.4.1 (2007-06-02)
136+
------------------
137+
138+
- Made WSGI server really WSGI-compliant by adding variables to the
139+
environment that are required by the spec.
140+
141+
142+
3.4.0 (2007-06-02)
143+
------------------
144+
145+
- Removed an unused import. Unchanged otherwise.
146+
147+
148+
3.4.0a1 (2007-04-22)
149+
--------------------
150+
151+
- Initial release as a separate project, corresponds to zope.server
152+
from Zope 3.4.0a1
153+
154+
- Made WSGI server really WSGI-compliant by adding variables to the
155+
environment that are required by the spec.

COPYRIGHT.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Zope Foundation and Contributors

LICENSE.txt

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Zope Public License (ZPL) Version 2.1
2+
3+
A copyright notice accompanies this license document that identifies the
4+
copyright holders.
5+
6+
This license has been certified as open source. It has also been designated as
7+
GPL compatible by the Free Software Foundation (FSF).
8+
9+
Redistribution and use in source and binary forms, with or without
10+
modification, are permitted provided that the following conditions are met:
11+
12+
1. Redistributions in source code must retain the accompanying copyright
13+
notice, this list of conditions, and the following disclaimer.
14+
15+
2. Redistributions in binary form must reproduce the accompanying copyright
16+
notice, this list of conditions, and the following disclaimer in the
17+
documentation and/or other materials provided with the distribution.
18+
19+
3. Names of the copyright holders must not be used to endorse or promote
20+
products derived from this software without prior written permission from the
21+
copyright holders.
22+
23+
4. The right to distribute this software or to use it for any purpose does not
24+
give you the right to use Servicemarks (sm) or Trademarks (tm) of the
25+
copyright
26+
holders. Use of them is covered by separate agreement with the copyright
27+
holders.
28+
29+
5. If any files are modified, you must cause the modified files to carry
30+
prominent notices stating that you changed the files and the date of any
31+
change.
32+
33+
Disclaimer
34+
35+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
36+
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
37+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
38+
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
39+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
41+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
42+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
43+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
44+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.txt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
This package contains generic base classes for channel-based servers, the
2+
servers themselves and helper objects, such as tasks and requests.
3+
4+
============
5+
WSGI Support
6+
============
7+
8+
`zope.server`'s HTTP server comes with WSGI_ support.
9+
``zope.server.http.wsgihttpserver.WSGIHTTPServer`` can act as a WSGI gateway.
10+
There's also an entry point for PasteDeploy_ that lets you use zope.server's
11+
WSGI gateway from a configuration file, e.g.::
12+
13+
[server:main]
14+
use = egg:zope.server
15+
host = 127.0.0.1
16+
port = 8080
17+
18+
.. _WSGI: http://www.python.org/dev/peps/pep-0333/
19+
.. _PasteDeploy: http://pythonpaste.org/deploy/

bootstrap.py

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
##############################################################################
2+
#
3+
# Copyright (c) 2006 Zope Foundation and Contributors.
4+
# All Rights Reserved.
5+
#
6+
# This software is subject to the provisions of the Zope Public License,
7+
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
8+
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9+
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10+
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11+
# FOR A PARTICULAR PURPOSE.
12+
#
13+
##############################################################################
14+
"""Bootstrap a buildout-based project
15+
16+
Simply run this script in a directory containing a buildout.cfg.
17+
The script accepts buildout command-line options, so you can
18+
use the -c option to specify an alternate configuration file.
19+
"""
20+
21+
import os, shutil, sys, tempfile, urllib2
22+
23+
tmpeggs = tempfile.mkdtemp()
24+
25+
ez = {}
26+
exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
27+
).read() in ez
28+
ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
29+
30+
import pkg_resources
31+
32+
cmd = 'from setuptools.command.easy_install import main; main()'
33+
if sys.platform == 'win32':
34+
cmd = '"%s"' % cmd # work around spawn lamosity on windows
35+
36+
ws = pkg_resources.working_set
37+
assert os.spawnle(
38+
os.P_WAIT, sys.executable, sys.executable,
39+
'-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
40+
dict(os.environ,
41+
PYTHONPATH=
42+
ws.find(pkg_resources.Requirement.parse('setuptools')).location
43+
),
44+
) == 0
45+
46+
ws.add_entry(tmpeggs)
47+
ws.require('zc.buildout')
48+
import zc.buildout.buildout
49+
zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
50+
shutil.rmtree(tmpeggs)

buildout.cfg

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[buildout]
2+
develop = .
3+
parts = test paste-test
4+
5+
[paste-test]
6+
recipe = zc.recipe.egg
7+
eggs = zope.server
8+
PasteDeploy
9+
PasteScript
10+
11+
[test]
12+
recipe = zc.recipe.testrunner
13+
eggs = zope.server [test]

setup.py

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
##############################################################################
2+
#
3+
# Copyright (c) 2006 Zope Foundation and Contributors.
4+
# All Rights Reserved.
5+
#
6+
# This software is subject to the provisions of the Zope Public License,
7+
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
8+
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9+
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10+
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11+
# FOR A PARTICULAR PURPOSE.
12+
#
13+
##############################################################################
14+
# This package is developed by the Zope Toolkit project, documented here:
15+
# http://docs.zope.org/zopetoolkit
16+
# When developing and releasing this package, please follow the documented
17+
# Zope Toolkit policies as described by this documentation.
18+
##############################################################################
19+
"""Setup for zope.server package
20+
"""
21+
import os
22+
from setuptools import setup, find_packages
23+
24+
def read(*rnames):
25+
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
26+
27+
28+
tests_require = [
29+
'zope.testing',
30+
'zope.i18n',
31+
'zope.component',
32+
]
33+
34+
35+
setup(
36+
name='zope.server',
37+
version='3.8.6dev',
38+
author='Zope Foundation and Contributors',
39+
author_email='[email protected]',
40+
description='Zope Server (Web and FTP)',
41+
long_description=(
42+
read('README.txt')
43+
+ '\n\n' +
44+
read('CHANGES.txt')
45+
),
46+
license='ZPL 2.1',
47+
keywords=('zope3 server http ftp'),
48+
classifiers = [
49+
'Development Status :: 5 - Production/Stable',
50+
'Environment :: Web Environment',
51+
'Intended Audience :: Developers',
52+
'License :: OSI Approved :: Zope Public License',
53+
'Programming Language :: Python',
54+
'Natural Language :: English',
55+
'Operating System :: OS Independent',
56+
'Topic :: Internet :: WWW/HTTP',
57+
'Framework :: Zope3'],
58+
url='http://pypi.python.org/pypi/zope.server',
59+
packages=find_packages('src'),
60+
package_dir = {'': 'src'},
61+
namespace_packages=['zope',],
62+
tests_require=tests_require,
63+
install_requires=[
64+
'setuptools',
65+
'zope.interface',
66+
'zope.publisher',
67+
'zope.security',
68+
],
69+
extras_require=dict(test=tests_require),
70+
include_package_data=True,
71+
zip_safe=False,
72+
entry_points="""
73+
[paste.server_runner]
74+
main = zope.server.http.wsgihttpserver:run_paste
75+
"""
76+
)

src/zope/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('pkg_resources').declare_namespace(__name__)

src/zope/server/__init__.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
##############################################################################
2+
#
3+
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
4+
# All Rights Reserved.
5+
#
6+
# This software is subject to the provisions of the Zope Public License,
7+
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
8+
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9+
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10+
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11+
# FOR A PARTICULAR PURPOSE.
12+
#
13+
##############################################################################
14+
"""Zope 3's Servers
15+
16+
This package contains generic base classes for channel-based servers, the
17+
servers themselves and helper objects, such as tasks and requests.
18+
"""
19+
import asyncore
20+
21+
from zope.server.interfaces import IDispatcher
22+
from zope.interface import classImplements
23+
24+
# Tell the the async.dispatcher that it implements IDispatcher.
25+
classImplements(asyncore.dispatcher, IDispatcher)

0 commit comments

Comments
 (0)