[Zope3-checkins] SVN: Zope3/branches/srichter-twisted-integration2/
Both ZServer and Twisted can be used now.
Stephan Richter
srichter at cosmos.phy.tufts.edu
Thu Sep 8 11:21:13 EDT 2005
Log message for revision 38403:
Both ZServer and Twisted can be used now.
Changed:
U Zope3/branches/srichter-twisted-integration2/Makefile
U Zope3/branches/srichter-twisted-integration2/src/zope/app/recorder/configure.zcml
U Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/SETUP.cfg
U Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/configure.zcml
U Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/ftp/configure.zcml
U Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/interfaces.py
U Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/servercontrol.py
D Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/zope.app.server-configure.zcml
A Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/zope.app.twisted-configure.zcml
A Zope3/branches/srichter-twisted-integration2/z3-twisted.py
U Zope3/branches/srichter-twisted-integration2/zope.conf.in
-=-
Modified: Zope3/branches/srichter-twisted-integration2/Makefile
===================================================================
--- Zope3/branches/srichter-twisted-integration2/Makefile 2005-09-08 14:45:46 UTC (rev 38402)
+++ Zope3/branches/srichter-twisted-integration2/Makefile 2005-09-08 15:21:12 UTC (rev 38403)
@@ -1,4 +1,4 @@
-PYTHON=python2.3
+PYTHON=python
TESTFLAGS=-v
TESTOPTS=
SETUPFLAGS=
Modified: Zope3/branches/srichter-twisted-integration2/src/zope/app/recorder/configure.zcml
===================================================================
--- Zope3/branches/srichter-twisted-integration2/src/zope/app/recorder/configure.zcml 2005-09-08 14:45:46 UTC (rev 38402)
+++ Zope3/branches/srichter-twisted-integration2/src/zope/app/recorder/configure.zcml 2005-09-08 15:21:12 UTC (rev 38403)
@@ -4,9 +4,9 @@
<utility
- name="RecordingHTTP"
+ name="Twisted-RecordingHTTP"
component=".recordinghttp"
- provides="zope.app.server.interfaces.IServerType"
+ provides="zope.app.twisted.interfaces.IServerType"
/>
<browser:page
Modified: Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/SETUP.cfg
===================================================================
--- Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/SETUP.cfg 2005-09-08 14:45:46 UTC (rev 38402)
+++ Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/SETUP.cfg 2005-09-08 15:21:12 UTC (rev 38403)
@@ -1,5 +1,5 @@
# Tell zpkg how to install the ZCML slugs.
<data-files zopeskel/etc/package-includes>
- zope.app.server-*.zcml
+ zope.app.twisted-*.zcml
</data-files>
Modified: Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/configure.zcml
===================================================================
--- Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/configure.zcml 2005-09-08 14:45:46 UTC (rev 38402)
+++ Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/configure.zcml 2005-09-08 15:21:12 UTC (rev 38403)
@@ -1,23 +1,25 @@
<configure xmlns="http://namespaces.zope.org/zope">
- <utility
+<!-- XXX: Temporary, till we figure this out.
+ <utility
component=".servercontrol.serverControl"
provides="zope.app.applicationcontrol.interfaces.IServerControl" />
+-->
<utility
- name="HTTP"
+ name="Twisted-HTTP"
component=".http.http"
provides=".interfaces.IServerType"
/>
<utility
- name="HTTPS"
+ name="Twisted-HTTPS"
component=".http.https"
provides=".interfaces.IServerType"
/>
<utility
- name="PostmortemDebuggingHTTP"
+ name="Twisted-PostmortemDebuggingHTTP"
component=".http.pmhttp"
provides=".interfaces.IServerType"
/>
Modified: Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/ftp/configure.zcml
===================================================================
--- Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/ftp/configure.zcml 2005-09-08 14:45:46 UTC (rev 38402)
+++ Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/ftp/configure.zcml 2005-09-08 15:21:12 UTC (rev 38403)
@@ -1,13 +1,13 @@
<configure xmlns="http://namespaces.zope.org/zope">
<utility
- name="SFTP"
+ name="Twisted-SFTP"
component=".sftpserver"
provides="..interfaces.IServerType"
/>
<utility
- name="FTP"
+ name="Twisted-FTP"
component=".ftpserver"
provides="..interfaces.IServerType"/>
Modified: Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/interfaces.py
===================================================================
--- Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/interfaces.py 2005-09-08 14:45:46 UTC (rev 38402)
+++ Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/interfaces.py 2005-09-08 15:21:12 UTC (rev 38403)
@@ -35,7 +35,7 @@
class ISSLServerType(IServerType):
"""SSL Server Type utility"""
-
+
def create(name, db, privateKeyPath, certificatePath, tls=False,
ip=None, port=None, backlog=50):
"""Create an SSL server instance.
@@ -68,7 +68,7 @@
request. Thus it is not advisable to store state in them. However, if
you have a special kind of `IFileSystemAccess` object that somhow
manages an `IFileSystem` for each set of credentials, then it would be
- possible to store some state on this obejct.
+ possible to store some state on this obejct.
"""
def type(path):
@@ -197,21 +197,21 @@
"""Create a directory.
If it is not possible or allowed to create the directory, an `OSError`
- should be raised describing the reason of failure.
+ should be raised describing the reason of failure.
"""
def remove(path):
"""Remove a file. Same as unlink.
If it is not possible or allowed to remove the file, an `OSError`
- should be raised describing the reason of failure.
+ should be raised describing the reason of failure.
"""
def rmdir(path):
"""Remove a directory.
If it is not possible or allowed to remove the directory, an `OSError`
- should be raised describing the reason of failure.
+ should be raised describing the reason of failure.
"""
def rename(old, new):
Modified: Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/servercontrol.py
===================================================================
--- Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/servercontrol.py 2005-09-08 14:45:46 UTC (rev 38402)
+++ Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/servercontrol.py 2005-09-08 15:21:12 UTC (rev 38403)
@@ -39,6 +39,6 @@
# Passing an exit status of 1 causes zdaemon to restart the process.
LoopCallback.exit_status = 1
-
+
serverControl = ServerControl()
Deleted: Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/zope.app.server-configure.zcml
===================================================================
--- Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/zope.app.server-configure.zcml 2005-09-08 14:45:46 UTC (rev 38402)
+++ Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/zope.app.server-configure.zcml 2005-09-08 15:21:12 UTC (rev 38403)
@@ -1 +0,0 @@
-<include package="zope.app.server" />
Copied: Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/zope.app.twisted-configure.zcml (from rev 38396, Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/zope.app.server-configure.zcml)
===================================================================
--- Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/zope.app.server-configure.zcml 2005-09-08 13:32:36 UTC (rev 38396)
+++ Zope3/branches/srichter-twisted-integration2/src/zope/app/twisted/zope.app.twisted-configure.zcml 2005-09-08 15:21:12 UTC (rev 38403)
@@ -0,0 +1 @@
+<include package="zope.app.twisted" />
Added: Zope3/branches/srichter-twisted-integration2/z3-twisted.py
===================================================================
--- Zope3/branches/srichter-twisted-integration2/z3-twisted.py 2005-09-08 14:45:46 UTC (rev 38402)
+++ Zope3/branches/srichter-twisted-integration2/z3-twisted.py 2005-09-08 15:21:12 UTC (rev 38403)
@@ -0,0 +1,63 @@
+#! /usr/bin/env python2.3
+##############################################################################
+#
+# 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.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.
+#
+##############################################################################
+"""Start script for Zope3: loads configuration and starts the server.
+
+$Id: z3.py 30640 2005-06-04 10:32:45Z frerich $
+"""
+import os
+import sys
+
+basepath = filter(None, sys.path)
+
+def run(argv=list(sys.argv)):
+
+ 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)
+
+ # Refuse to run without principals.zcml
+ if not os.path.exists('principals.zcml'):
+ print """\
+ ERROR: You need to create principals.zcml
+
+ The file principals.zcml contains your "bootstrap" user
+ database. You aren't going to get very far without it. Start
+ by copying sample_principals.zcml and then modify the
+ example principal and role settings.
+ """
+ sys.exit(1)
+
+ # setting python paths
+ program = argv[0]
+ if "--build" in argv:
+ argv.remove("--build")
+ from distutils.util import get_platform
+ PLAT_SPEC = "%s-%s" % (get_platform(), sys.version[0:3])
+ src = os.path.join("build", "lib.%s" % PLAT_SPEC)
+ else:
+ src = 'src'
+
+ here = os.path.dirname(os.path.abspath(program))
+ srcdir = os.path.abspath(src)
+ sys.path = [srcdir, here] + basepath
+
+ from zope.app.twisted.main import main
+ main(argv[1:])
+
+
+if __name__ == '__main__':
+ run()
Property changes on: Zope3/branches/srichter-twisted-integration2/z3-twisted.py
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: Zope3/branches/srichter-twisted-integration2/zope.conf.in
===================================================================
--- Zope3/branches/srichter-twisted-integration2/zope.conf.in 2005-09-08 14:45:46 UTC (rev 38402)
+++ Zope3/branches/srichter-twisted-integration2/zope.conf.in 2005-09-08 15:21:12 UTC (rev 38403)
@@ -6,13 +6,13 @@
interrupt-check-interval 200
<server>
- type HTTP
+ type Twisted-HTTP
address 8080
</server>
# Ready to go HTTPS server. You just need to make sure OpenSSL is installed.
# <sslserver>
-# type HTTPS
+# type Twisted-HTTPS
# address 8443
# privatekeypath server.pem
# certificatepath server.pem
@@ -22,25 +22,25 @@
# (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.
#<server>
-# type PostmortemDebuggingHTTP
+# type Twisted-PostmortemDebuggingHTTP
# address 8080
#</server>
# A special HTTP server that records HTTP session that can be converted to
# functional tests.
# <server>
-# type RecordingHTTP
+# type Twisted-RecordingHTTP
# address 8081
# </server>
<server>
- type FTP
+ type Twisted-FTP
address 8021
</server>
# You must install pycrypto to use the SFTP server.
# <sshserver>
-# type SFTP
+# type Twisted-SFTP
# address 8115
# hostkey ssh_host_rsa_key
# </sshserver>
More information about the Zope3-Checkins
mailing list