[z3-checkins] r5118 - in z3/modzope: . branch tag trunk
trunk/demosite trunk/demosite/package-includes trunk/src
trunk/src/modzope trunk/src/modzope/apache
trunk/src/modzope/mod_python
philikon at codespeak.net
philikon at codespeak.net
Wed Jun 16 17:01:57 MEST 2004
Author: philikon
Date: Wed Jun 16 17:01:56 2004
New Revision: 5118
Added:
z3/modzope/
z3/modzope/branch/
z3/modzope/tag/
z3/modzope/trunk/
z3/modzope/trunk/README.txt
z3/modzope/trunk/demosite/
z3/modzope/trunk/demosite/README.txt
z3/modzope/trunk/demosite/apache2.conf
z3/modzope/trunk/demosite/overrides.zcml.in
z3/modzope/trunk/demosite/package-includes/
z3/modzope/trunk/demosite/package-includes/README.txt
z3/modzope/trunk/demosite/package-includes/apidoc-configure.zcml
z3/modzope/trunk/demosite/package-includes/buddydemo-configure.zcml
z3/modzope/trunk/demosite/package-includes/bundle-configure.zcml
z3/modzope/trunk/demosite/package-includes/dav-configure.zcml
z3/modzope/trunk/demosite/package-includes/dav-meta.zcml
z3/modzope/trunk/demosite/package-includes/debugskin-configure.zcml
z3/modzope/trunk/demosite/package-includes/dtmlpage-configure.zcml
z3/modzope/trunk/demosite/package-includes/file-configure.zcml
z3/modzope/trunk/demosite/package-includes/ftp-configure.zcml
z3/modzope/trunk/demosite/package-includes/i18nfile-configure.zcml
z3/modzope/trunk/demosite/package-includes/insensitivefolder-configure.zcml
z3/modzope/trunk/demosite/package-includes/interpreter-configure.zcml
z3/modzope/trunk/demosite/package-includes/mail-configure.zcml
z3/modzope/trunk/demosite/package-includes/mail-meta.zcml
z3/modzope/trunk/demosite/package-includes/modzope-configure.zcml
z3/modzope/trunk/demosite/package-includes/onlinehelp-configure.zcml
z3/modzope/trunk/demosite/package-includes/onlinehelp-meta.zcml
z3/modzope/trunk/demosite/package-includes/presentation-configure.zcml
z3/modzope/trunk/demosite/package-includes/pythonpage-configure.zcml
z3/modzope/trunk/demosite/package-includes/rdb-configure.zcml
z3/modzope/trunk/demosite/package-includes/rdb-meta.zcml
z3/modzope/trunk/demosite/package-includes/renderer-configure.zcml
z3/modzope/trunk/demosite/package-includes/renderer-meta.zcml
z3/modzope/trunk/demosite/package-includes/schemacontent-configure.zcml
z3/modzope/trunk/demosite/package-includes/securitypolicy-meta.zcml
z3/modzope/trunk/demosite/package-includes/sqlexpr-configure.zcml
z3/modzope/trunk/demosite/package-includes/sqlscript-configure.zcml
z3/modzope/trunk/demosite/package-includes/tree-configure.zcml
z3/modzope/trunk/demosite/package-includes/undo-configure.zcml
z3/modzope/trunk/demosite/package-includes/wiki-configure.zcml
z3/modzope/trunk/demosite/package-includes/workflow-configure.zcml
z3/modzope/trunk/demosite/package-includes/xmlrpc-configure.zcml
z3/modzope/trunk/demosite/package-includes/z3checkins-configure.zcml
z3/modzope/trunk/demosite/package-includes/zope.app.dtmlpage.fssync-configure.zcml
z3/modzope/trunk/demosite/package-includes/zope.app.dublincore.fssync-configure.zcml
z3/modzope/trunk/demosite/package-includes/zope.app.file.fssync-configure.zcml
z3/modzope/trunk/demosite/package-includes/zope.app.folder.fssync-configure.zcml
z3/modzope/trunk/demosite/package-includes/zope.app.fssync-configure.zcml
z3/modzope/trunk/demosite/package-includes/zope.app.fssync-meta.zcml
z3/modzope/trunk/demosite/package-includes/zope.app.menu-configure.zcml
z3/modzope/trunk/demosite/package-includes/zope.app.module.fssync-configure.zcml
z3/modzope/trunk/demosite/package-includes/zope.app.registration.fssync-configure.zcml
z3/modzope/trunk/demosite/package-includes/zope.app.server-configure.zcml
z3/modzope/trunk/demosite/package-includes/zope.app.session-configure.zcml
z3/modzope/trunk/demosite/package-includes/zope.app.site.fssync-configure.zcml
z3/modzope/trunk/demosite/package-includes/zope.app.utility.fssync-configure.zcml
z3/modzope/trunk/demosite/package-includes/zope.app.zptpage.fssync-configure.zcml
z3/modzope/trunk/demosite/package-includes/zopetop-configure.zcml
z3/modzope/trunk/demosite/package-includes/zptpage-configure.zcml
z3/modzope/trunk/demosite/sample_principals.zcml
z3/modzope/trunk/demosite/securitypolicy.zcml
z3/modzope/trunk/demosite/site.zcml
z3/modzope/trunk/src/
z3/modzope/trunk/src/modzope/
z3/modzope/trunk/src/modzope/__init__.py
z3/modzope/trunk/src/modzope/apache/
z3/modzope/trunk/src/modzope/apache/__init__.py
z3/modzope/trunk/src/modzope/apache/browser.py
z3/modzope/trunk/src/modzope/apache/configure.zcml
z3/modzope/trunk/src/modzope/apache/field.py
z3/modzope/trunk/src/modzope/apache/http.py
z3/modzope/trunk/src/modzope/apache/interfaces.py
z3/modzope/trunk/src/modzope/app.py
z3/modzope/trunk/src/modzope/configure.zcml
z3/modzope/trunk/src/modzope/mod_python/
z3/modzope/trunk/src/modzope/mod_python/__init__.py
z3/modzope/trunk/src/modzope/mod_python/handlers.py
z3/modzope/trunk/src/modzope/mod_python/interfaces.py
Log:
Added my modzope package. This an experimental attempt to run Zope3 within Apache2
using mod_python3.
Added: z3/modzope/trunk/README.txt
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/README.txt Wed Jun 16 17:01:56 2004
@@ -0,0 +1,45 @@
+=======
+modzope
+=======
+
+What is modzope?
+----------------
+
+modzope is an experimental module that connects the Zope 3 application
+server to Apache 2. This makes it possible to run a Zope 3
+application within a regular Apache server, without Zope's one server
+process. modzope uses mod_python to hook into Apache.
+
+
+Why on earth would one want to do this?
+---------------------------------------
+
+Apache is a well-known and proven webserver. Its server backend has
+proven to be stable and mature. It is fast, scales well; Apache's
+numerous add-on modules, such as mod_proxy and mod_ssl add invaluable
+features to a web application.
+
+Zope's zope.server is a custom component. No tests so far have proven
+it either stable or unstable, fast or slow, well or badly scaling. In
+other words, there is an incalcuable uncertainty lying in that
+component. Furthermore, Zope2 history has shown that in serious
+applications, one always uses Apache as a frontend to Zope in order to
+gain more flexibility, caching controls and SSL capability. Even
+though this has proven to be fast, it is an unnecessarily complicated
+setup with questionable indirection.
+
+
+What's the status?
+------------------
+
+Highly experimental. Extremely highly experimental. It is hard to
+say whether it will ever be mature. Consider it to be a proof of
+concept for now.
+
+
+Copyright
+---------
+
+modzope is copyrighted (c) 2004 by Philipp "philiKON" von
+Weitershausen. It is freely distributable under the terms of the Zope
+Public License Version 2.1 (ZPL), as distributed with Zope 3.
Added: z3/modzope/trunk/demosite/README.txt
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/README.txt Wed Jun 16 17:01:56 2004
@@ -0,0 +1,20 @@
+============
+modzope site
+============
+
+This directory contains all configuration and data files for a modzope
+site. Its contents is very similar to a standard Zope3 site:
+
+ o site.zcml
+ securitypolicy.zcml
+ sample_principals.zcml
+ package-includes/
+
+ Those are verbatim copies from a standard Zope3 site
+
+XXX use svn:externals?
+
+ o package-includes/modzope-configure.zcml
+
+ This file merely loads modzope-specific configuration directives
+
Added: z3/modzope/trunk/demosite/apache2.conf
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/apache2.conf Wed Jun 16 17:01:56 2004
@@ -0,0 +1,130 @@
+# ==================================
+# Modzope configuration for Apache 2
+# ==================================
+#
+# Include this configuration file in your Apache2 configuration file
+# in an appropriate place, e.g.
+#
+# <Directory /var/www/>
+# ...
+# Include "/home/zope/modzope/demosite/apache2.conf"
+# </Directory>
+#
+
+### mod_python configuration ###
+
+# Directive: SetHandler
+#
+# Description:
+# Forces all matching files to be parsed through the handler given
+# as argument.
+#
+# Default: None
+#
+# Example:
+ SetHandler mod_python
+
+# Directive: PythonPath
+#
+# Description:
+# Sets the python path for mod_python interpreters. Anything
+# specified here overrides sys.path; it does not append! You may,
+# however, specify sys.path as PythonPath and add your custom
+# paths to it.
+#
+# Default: sys.path
+#
+# Example:
+ PythonPath "sys.path+['/home/zope/modzope/src', '/home/zope/Zope3/src']"
+
+# Directive: PythonDebug
+#
+# Description:
+# Normally, the traceback output resulting from uncaught Python
+# errors is sent to the error log. If PythonDebug enabled (On),
+# the output will be sent to the client (as well as the log),
+# except when the error is IOError while writing, in which case it
+# will go to the error log.
+#
+# Default: Off
+#
+# Example:
+ PythonDebug On
+
+
+### modzope handlers ###
+
+# Directive: PythonHandler
+#
+# Description:
+# Specifies the main request handler when using mod_python
+#
+# Default: None
+#
+# Example:
+ PythonHandler modzope.mod_python.handlers
+
+# Directive: PythonTypeHandler
+#
+# Description:
+# Calls a handler to determine and/or set the various document
+# type information bits, like content-type, language, et cetera.
+#
+# Default: None
+#
+# Example:
+# PythonTypeHandler modzope.mod_python.handlers
+
+# Directive: PythonPostReadRequestHandler
+#
+# Description:
+# XXX i think this can be used to decide which request/response to
+# use # (i.e. which HTTP protocol to use: http, browser, webdav,
+# xmlrpc, # etc.)
+#
+# Default: None
+#
+# Example:
+# PythonPostReadRequestHandler modzope.mod_python.handlers
+
+
+### modzope configuration ###
+
+# modzope can be configured using a couple of options set using the
+# PythonOption directive.
+
+# Option: sitepath
+#
+# Description:
+# Specifies the path to the modzope site. A site includes a site
+# configuration file (typically site.zcml), bootstrap principal
+# definitions (typically principals.zcml) and the ZODB database
+# file (typically Data.fs).
+#
+# Make sure the directory you specify here is readable to the user
+# Apache2 is running as.
+#
+# Default: the directory Apache2 was started from
+#
+# Example:
+ PythonOption sitepath /home/zope/modzope/demosite
+
+# Option: dbfile
+#
+# Description:
+# Specifies the full absolute path to the ZODB database file.
+#
+# Default: $sitepath/Data.fs
+#
+# Example:
+# PythonOption dbfile /home/zope/modzope/demosite/Data.fs
+
+# Option: siteconfig
+#
+# Description:
+# Specifies the full absolute path to the site configuration file.
+#
+# Default: $sitepath/site.zcml
+#
+# Example:
+# PythonOption siteconfig /home/zope/modzope/demosite/site.zcml
Added: z3/modzope/trunk/demosite/overrides.zcml.in
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/overrides.zcml.in Wed Jun 16 17:01:56 2004
@@ -0,0 +1,9 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser">
+
+ <!-- Provide local overrides of standard configurations -->
+
+ <!-- For example, define a different default skin -->
+ <!-- <browser:skin name="" layers="default" /> -->
+
+</configure>
Added: z3/modzope/trunk/demosite/package-includes/README.txt
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/README.txt Wed Jun 16 17:01:56 2004
@@ -0,0 +1,2 @@
+This directory is a place where small include files can be inserted
+during product installation.
Added: z3/modzope/trunk/demosite/package-includes/apidoc-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/apidoc-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.apidoc"/>
Added: z3/modzope/trunk/demosite/package-includes/buddydemo-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/buddydemo-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="buddydemo" />
Added: z3/modzope/trunk/demosite/package-includes/bundle-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/bundle-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.bundle"/>
Added: z3/modzope/trunk/demosite/package-includes/dav-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/dav-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.dav"/>
Added: z3/modzope/trunk/demosite/package-includes/dav-meta.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/dav-meta.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.dav" file="meta.zcml"/>
Added: z3/modzope/trunk/demosite/package-includes/debugskin-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/debugskin-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.debugskin"/>
Added: z3/modzope/trunk/demosite/package-includes/dtmlpage-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/dtmlpage-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.dtmlpage" />
Added: z3/modzope/trunk/demosite/package-includes/file-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/file-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.file"/>
Added: z3/modzope/trunk/demosite/package-includes/ftp-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/ftp-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.ftp"/>
Added: z3/modzope/trunk/demosite/package-includes/i18nfile-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/i18nfile-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.i18nfile"/>
Added: z3/modzope/trunk/demosite/package-includes/insensitivefolder-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/insensitivefolder-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.demo.insensitivefolder" />
Added: z3/modzope/trunk/demosite/package-includes/interpreter-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/interpreter-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.interpreter"/>
Added: z3/modzope/trunk/demosite/package-includes/mail-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/mail-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.mail"/>
Added: z3/modzope/trunk/demosite/package-includes/mail-meta.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/mail-meta.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.mail" file="meta.zcml"/>
Added: z3/modzope/trunk/demosite/package-includes/modzope-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/modzope-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="modzope" />
\ No newline at end of file
Added: z3/modzope/trunk/demosite/package-includes/onlinehelp-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/onlinehelp-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.onlinehelp"/>
Added: z3/modzope/trunk/demosite/package-includes/onlinehelp-meta.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/onlinehelp-meta.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.onlinehelp" file="meta.zcml"/>
Added: z3/modzope/trunk/demosite/package-includes/presentation-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/presentation-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.presentation" />
Added: z3/modzope/trunk/demosite/package-includes/pythonpage-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/pythonpage-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.pythonpage"/>
Added: z3/modzope/trunk/demosite/package-includes/rdb-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/rdb-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.rdb"/>
Added: z3/modzope/trunk/demosite/package-includes/rdb-meta.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/rdb-meta.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.rdb" file="meta.zcml"/>
Added: z3/modzope/trunk/demosite/package-includes/renderer-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/renderer-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.renderer"/>
Added: z3/modzope/trunk/demosite/package-includes/renderer-meta.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/renderer-meta.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.renderer" file="meta.zcml"/>
Added: z3/modzope/trunk/demosite/package-includes/schemacontent-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/schemacontent-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.schemacontent"/>
Added: z3/modzope/trunk/demosite/package-includes/securitypolicy-meta.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/securitypolicy-meta.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.securitypolicy" file="meta.zcml" />
Added: z3/modzope/trunk/demosite/package-includes/sqlexpr-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/sqlexpr-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.sqlexpr" />
Added: z3/modzope/trunk/demosite/package-includes/sqlscript-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/sqlscript-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.sqlscript"/>
Added: z3/modzope/trunk/demosite/package-includes/tree-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/tree-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.tree"/>
Added: z3/modzope/trunk/demosite/package-includes/undo-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/undo-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.undo"/>
Added: z3/modzope/trunk/demosite/package-includes/wiki-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/wiki-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.wiki" />
Added: z3/modzope/trunk/demosite/package-includes/workflow-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/workflow-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.workflow"/>
Added: z3/modzope/trunk/demosite/package-includes/xmlrpc-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/xmlrpc-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.xmlrpc"/>
Added: z3/modzope/trunk/demosite/package-includes/z3checkins-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/z3checkins-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="z3checkins" />
Added: z3/modzope/trunk/demosite/package-includes/zope.app.dtmlpage.fssync-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zope.app.dtmlpage.fssync-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.dtmlpage.fssync" />
Added: z3/modzope/trunk/demosite/package-includes/zope.app.dublincore.fssync-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zope.app.dublincore.fssync-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.dublincore.fssync" />
Added: z3/modzope/trunk/demosite/package-includes/zope.app.file.fssync-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zope.app.file.fssync-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.file.fssync" />
Added: z3/modzope/trunk/demosite/package-includes/zope.app.folder.fssync-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zope.app.folder.fssync-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.folder.fssync" />
Added: z3/modzope/trunk/demosite/package-includes/zope.app.fssync-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zope.app.fssync-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.fssync" />
Added: z3/modzope/trunk/demosite/package-includes/zope.app.fssync-meta.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zope.app.fssync-meta.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.fssync" file="meta.zcml" />
Added: z3/modzope/trunk/demosite/package-includes/zope.app.menu-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zope.app.menu-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.menu" />
Added: z3/modzope/trunk/demosite/package-includes/zope.app.module.fssync-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zope.app.module.fssync-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.module.fssync" />
Added: z3/modzope/trunk/demosite/package-includes/zope.app.registration.fssync-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zope.app.registration.fssync-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.registration.fssync" />
Added: z3/modzope/trunk/demosite/package-includes/zope.app.server-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zope.app.server-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.server" />
Added: z3/modzope/trunk/demosite/package-includes/zope.app.session-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zope.app.session-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.session" />
Added: z3/modzope/trunk/demosite/package-includes/zope.app.site.fssync-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zope.app.site.fssync-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.site.fssync" />
Added: z3/modzope/trunk/demosite/package-includes/zope.app.utility.fssync-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zope.app.utility.fssync-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.utility.fssync" />
Added: z3/modzope/trunk/demosite/package-includes/zope.app.zptpage.fssync-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zope.app.zptpage.fssync-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.zptpage.fssync" />
Added: z3/modzope/trunk/demosite/package-includes/zopetop-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zopetop-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.zopetop"/>
Added: z3/modzope/trunk/demosite/package-includes/zptpage-configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/package-includes/zptpage-configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.zptpage"/>
Added: z3/modzope/trunk/demosite/sample_principals.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/sample_principals.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1,35 @@
+<!-- Use this as an example for setting up your principals -->
+<!-- file. Don't simply copy this file to principals.zcml -->
+<!-- unless you absolutely know it will only be used for -->
+<!-- development. -->
+<configure xmlns='http://namespaces.zope.org/zope'>
+
+ <unauthenticatedPrincipal
+ id="zope.anybody"
+ title="Unauthenticated User" />
+
+ <principal
+ id="zope.sample_manager"
+ title="Sample Manager"
+ login="gandalf"
+ password="123"
+ />
+
+ <principal
+ id="zope.sample_member"
+ title="Sample ordinary user (member)"
+ login="frodo"
+ password="456"
+ />
+
+ <grant
+ role="zope.Manager"
+ principal="zope.sample_manager"
+ />
+
+ <grant
+ role="zope.Member"
+ principal="zope.sample_member"
+ />
+
+</configure>
Added: z3/modzope/trunk/demosite/securitypolicy.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/securitypolicy.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+<include package="zope.app.securitypolicy" />
Added: z3/modzope/trunk/demosite/site.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/demosite/site.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1,14 @@
+<configure xmlns="http://namespaces.zope.org/zope">
+
+ <include package="zope.app" />
+
+ <include files="package-includes/*-meta.zcml" />
+ <include files="package-includes/*-configure.zcml" />
+
+ <!-- Provide local overrides of standard configurations-->
+ <includeOverrides file="overrides.zcml" />
+
+ <include file="securitypolicy.zcml" />
+ <include file="principals.zcml" />
+
+</configure>
Added: z3/modzope/trunk/src/modzope/__init__.py
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/src/modzope/__init__.py Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+# make this directory a package
Added: z3/modzope/trunk/src/modzope/apache/__init__.py
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/src/modzope/apache/__init__.py Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+# make this directory a package
Added: z3/modzope/trunk/src/modzope/apache/browser.py
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/src/modzope/apache/browser.py Wed Jun 16 17:01:56 2004
@@ -0,0 +1,36 @@
+##############################################################################
+#
+# Copyright (c) 2004 Philipp "philiKON" von Weitershausen
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Browser request/response adapters
+
+$Id: browser.py 177 2004-05-01 21:41:54Z philipp $
+"""
+from zope.publisher.browser import BrowserRequest as ZopeBrowserRequest
+from zope.publisher.browser import BrowserResponse as ZopeBrowserResponse
+from modzope.apache.http import HTTPRequest, HTTPResponse
+
+class BrowserRequest(HTTPRequest, ZopeBrowserRequest):
+ """Adapter from Apache's request to zope.publisher's browser
+ request."""
+
+ def __init__(self, context):
+ self.form = {}
+ self.charsets = None
+ super(BrowserRequest, self).__init__(context)
+
+ def _createResponse(self, context):
+ return BrowserResponse(context)
+
+class BrowserResponse(HTTPResponse, ZopeBrowserResponse):
+ """Adapter from Apache's request to zope.publisher's brwoser
+ response."""
Added: z3/modzope/trunk/src/modzope/apache/configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/src/modzope/apache/configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1,15 @@
+<configure xmlns="http://namespaces.zope.org/zope">
+
+ <adapter
+ for="modzope.apache.interfaces.IApacheRequest"
+ provides="zope.publisher.interfaces.http.IHTTPRequest"
+ factory="modzope.apache.http.HTTPRequest"
+ />
+
+ <adapter
+ for="modzope.apache.interfaces.IApacheRequest"
+ provides="zope.publisher.interfaces.browser.IBrowserRequest"
+ factory="modzope.apache.browser.BrowserRequest"
+ />
+
+</configure>
Added: z3/modzope/trunk/src/modzope/apache/field.py
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/src/modzope/apache/field.py Wed Jun 16 17:01:56 2004
@@ -0,0 +1,53 @@
+##############################################################################
+#
+# Copyright (c) 2004 Philipp "philiKON" von Weitershausen
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Schema fields
+
+$Id: field.py 171 2004-05-01 15:04:32Z philipp $
+"""
+from zope.interface import implements
+from zope.schema import Dict, Bytes
+from zope.schema.interfaces import IDict
+
+class IAPRTable(IDict):
+ """Field that describes an Apache Portable Runtime table object.
+
+ A table behaves very much like a dictionary, with the following
+ differences:
+
+ * Both keys and values must be strings.
+
+ * Key lookups are case-insensitive.
+
+ * Duplicate keys are allowed. When there is more than one value
+ for a key, a subscript operation returns a list.
+ """
+
+class APRTable(Dict):
+ __doc__ = IAPRTable.__doc__
+ implements(IAPRTable)
+
+ # we really can't get a hold of the actual type object
+ _type = object
+
+ key_type = Bytes(
+ title=u"Key type",
+ description=u"Lookup is case-insensitive"
+ )
+
+ value_type = Bytes(
+ title=u"Value type"
+ )
+
+ def __init__(self, **kw):
+ super(Dict, self).__init__(**kw)
Added: z3/modzope/trunk/src/modzope/apache/http.py
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/src/modzope/apache/http.py Wed Jun 16 17:01:56 2004
@@ -0,0 +1,187 @@
+##############################################################################
+#
+# Copyright (c) 2004 Philipp "philiKON" von Weitershausen
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""HTTP request/response adapters
+
+$Id: http.py 178 2004-05-05 07:42:06Z philipp $
+"""
+from zope.publisher.http import HTTPRequest as ZopeHTTPRequest
+from zope.publisher.http import HTTPResponse as ZopeHTTPResponse
+from zope.publisher.http import status_codes, status_reasons
+from modzope.apache.interfaces import IApacheRequest, IApacheResponse
+
+class FileWrapper(object):
+ """File wrapper around Apache's request objects.
+
+ This makes Apache's requests feel almost like Python file
+ objects. This allows us to utilitize most of zope.publisher's
+ machinery for request/response IO because it expects standard IO
+ stream objects.
+ """
+
+ def __init__(self, context, mode='r'):
+ self.context = context
+ self.mode = mode
+ assert mode in ['r', 'w', 'rw']
+
+ # most methods can be used directly
+ self.read = context.read
+ self.readline = context.readline
+ self.readlines = context.readlines
+ self.flush = context.flush
+ self.write = context.write
+
+ def getvalue(self):
+ return self.context.read()
+
+ def isatty(self):
+ return False
+
+ def tell(self):
+ if mode == 'r' or mode == 'rw':
+ return self.context.read_length
+ elif mode == 'w':
+ return self.context.bytes_sent
+
+ def close(self):
+ self.flush()
+ # can't do anything else
+
+ def seek(self, pos, mode=0):
+ # not supported
+ pass
+
+ def writelines(self, list):
+ # maybe use OS-specific newline ending
+ self.context.write("\n".join(list))
+
+class HTTPRequest(ZopeHTTPRequest):
+ """Adapter from Apache's request to zope.publisher's HTTP
+ request."""
+
+ __used_for__ = IApacheRequest
+
+ def __init__(self, context):
+ self.context = context
+
+ body_instream = FileWrapper(context, 'r')
+ outstream = FileWrapper(context, 'w')
+ response = self._createResponse(context)
+
+ context.add_common_vars()
+ environ = {}
+ environ.update(self.context.subprocess_env)
+ # maybe use req.parsed_uri[apache.URI_PATH]
+ environ["PATH_INFO"] = context.uri
+ basic = context.get_basic_auth_pw()
+ if basic:
+ import base64
+ environ['HTTP_AUTHORIZATION'] = "Basic %s" % base64.encodestring(basic)
+
+ super(HTTPRequest, self).__init__(body_instream, outstream, environ, response)
+
+ def _createResponse(self, context):
+ return HTTPResponse(context)
+
+ def supportsRetry(self):
+ """See zope.publisher.interfaces.IPublisherRequest"""
+ return False
+
+ def retry(self):
+ """See zope.publisher.interfaces.IPublisherRequest"""
+ # not supported
+ pass
+
+class HTTPResponse(ZopeHTTPResponse):
+ """Adapter from Apache's request to zope.publisher's HTTP
+ response."""
+
+ __used_for__ = IApacheResponse
+
+ def __init__(self, context):
+ self.context = context
+ outstream = FileWrapper(context, 'w')
+
+ # we have our own mechanisms for headers
+ header_output = None
+ http_transaction = None #what is this???
+ super(HTTPResponse, self).__init__(outstream, header_output, http_transaction)
+
+ def outputHeaders(self):
+ # XXX I think we have to override this method because we set
+ # the headers on the apache table. So, do nothing
+ # here. (?). Maybe fix up the content type for charset?
+ pass
+
+ def setStatus(self, status, reason=None):
+ """See zope.publisher.interfaces.http.IHTTPResponse"""
+ if status is None:
+ status = 200
+ else:
+ if isinstance(status, (str, unicode)):
+ status = status.lower()
+ if status in status_codes:
+ status = status_codes[status]
+ else:
+ status = 500
+
+ self.context.status = status
+ self._status_set = True
+
+ def getStatus(self):
+ """See zope.publisher.interfaces.http.IHTTPResponse"""
+ return self.context.status
+
+ def setHeader(self, name, value, literal=False):
+ """See zope.publisher.interfaces.http.IHTTPResponse"""
+ # the literal parameter is ignored since APR table objects are
+ # case insensitive anyway.
+ name = str(name)
+ value = str(value)
+
+ if name.lower() == 'content-length':
+ self.context.set_content_length(int(value))
+ elif name.lower() == 'content-type':
+ self.context.content_type = value
+ else:
+ self.context.headers_out[name] = value
+
+ def addHeader(self, name, value):
+ """See zope.publisher.interfaces.http.IHTTPResponse"""
+ self.setHeader(name, value)
+
+ def getHeader(self, name, default=None, literal=False):
+ """See zope.publisher.interfaces.http.IHTTPResponse"""
+ # the literal parameter is ignored since APR table objects are
+ # case incensitive anyway.
+ return self.context.headers_out.get(name, default)
+
+ def getHeaders(self):
+ """See zope.publisher.interfaces.http.IHTTPResponse"""
+ result = {'Content-Type': self.context.content_type}
+ result.update(self.context.headers_out)
+ return result
+ headers = self._headers
+
+ def appendToHeader(self, name, value, delimiter=','):
+ """See zope.publisher.interfaces.http.IHTTPResponse"""
+ # the delimiter parameter is ignored since APR table objects
+ # are case incensitive anyway.
+ self.setHeader(name, value)
+
+ # XXX not supported
+ def retry(self):
+ """Returns a response object to be used in a retry attempt
+ """
+ pass
+
Added: z3/modzope/trunk/src/modzope/apache/interfaces.py
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/src/modzope/apache/interfaces.py Wed Jun 16 17:01:56 2004
@@ -0,0 +1,623 @@
+##############################################################################
+#
+# Copyright (c) 2004 Philipp "philiKON" von Weitershausen
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Apache interfaces
+
+$Id: interfaces.py 176 2004-05-01 21:27:34Z philipp $
+"""
+from zope.interface import Interface, Attribute
+from zope.schema import Int, Bool, TextLine, Bytes, BytesLine, Tuple
+from modzope.apache.field import APRTable
+
+class IApacheConnection(Interface):
+ """Describes a connection Apache holds with the client."""
+
+ def read(length=-1):
+ """See YYY"""
+
+ def readlines(length=-1):
+ """See YYY"""
+
+ def write(string):
+ """See YYY"""
+
+ # server object
+ # readonly
+ base_server = Attribute(
+ """See YYY"""
+ )
+
+ local_addr = Tuple(
+ title=u"Local address",
+ description=u"See YYY",
+ readonly=True
+ )
+
+ remote_addr = Tuple(
+ title=u"Remote address",
+ description=u"See YYY",
+ readonly=True
+ )
+
+ remote_ip = BytesLine(
+ title=u"Remote IP address",
+ description=u"See YYY",
+ readonly=True
+ )
+
+ remote_host = BytesLine(
+ title=u"Remote hostname",
+ description=u"See YYY",
+ readonly=True
+ )
+
+ remote_logname = BytesLine(
+ title=u"Remote name (RFC1413)",
+ description=u"See YYY",
+ readonly=True
+ )
+
+ aborted = Bool(
+ title=u"Aborted",
+ description=u"See YYY",
+ readonly=True
+ )
+
+ keepalive = Int(
+ title=u"Keep alive",
+ description=u"See YYY",
+ readonly=True
+ )
+
+ double_reverse = Int(
+ title=u"Double reverse DNS lookup",
+ description=u"See YYY",
+ readonly=True
+ )
+
+ local_ip = BytesLine(
+ title=u"Local IP address",
+ description=u"See YYY",
+ readonly=True
+ )
+
+ local_host = BytesLine(
+ title=u"Local hostname",
+ description=u"See YYY",
+ readonly=True
+ )
+
+ id = Int(
+ title=u"Connection ID",
+ description=u"See YYY",
+ readonly=True
+ )
+
+ notes = APRTable(
+ title=u"Notes",
+ description=u"See YYY",
+ )
+
+class IApacheServer(Interface):
+ """Represents the Apache server"""
+
+ def get_config():
+ """See ZZZ"""
+
+ def register_cleanup(request, callable, data=None):
+ """See ZZZ"""
+
+ defn_name = BytesLine(
+ title=u"Configuration filename",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ defn_line_number = Int(
+ title=u"Config file line number",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ server_admin = BytesLine(
+ title=u"Server admin",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ server_hostname = BytesLine(
+ title=u"Server hostname",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ port = Int(
+ title=u"TCP/IP Port number",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ error_fname = BytesLine(
+ title=u"Error log filename",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ loglevel = Int(
+ title=u"Loglevel",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ is_ivrtual = Bool(
+ title=u"Virtual server",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ timeout = Int(
+ title=u"Timeout",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ keep_alive_timeout = Int(
+ title=u"Keepalive timeout",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ keep_alive_max = Int(
+ title=u"Maximum no. of requests",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ keep_alive = Bool(
+ title=u"Uses persistent connections",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ path = BytesLine(
+ title=u"Server path",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ pathlen = Int(
+ title=u"Path length",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ limit_req_line = Int(
+ title=u"Request line size limit",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ limit_req_fieldsize = Int(
+ title=u"Request header field size limit",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+ limit_req_fields = Int(
+ title=u"Request header fields limit",
+ description=u"See ZZZ",
+ readonly=True
+ )
+
+class IApacheProcess(Interface):
+ """Describes the process happening in Apache when a request comes
+ in and a response is sent."""
+
+ def add_handler(htype, handler, dir=None):
+ """See XXX"""
+
+ def register_cleanup(callable, data=None):
+ """See XXX"""
+
+ def log_error(message, level=None):
+ """See XXX"""
+
+ notes = APRTable(
+ title=u"Notes",
+ description=u"See XXX",
+ )
+
+ phase = BytesLine( #?
+ title=u"Phase currently in process",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ handler = BytesLine(
+ title=u"Name of the current handler",
+ description=u"See XXX",
+ readonly=True
+ )
+
+class IApacheConfig(Interface):
+ """Provides access to Apache's configuration."""
+
+ def document_root():
+ """See XXX"""
+
+ def get_config():
+ """See XXX"""
+
+ def get_options():
+ """See XXX"""
+
+ def requires():
+ """See XXX"""
+
+class IApacheResponse(Interface):
+ """Apache's response"""
+
+ def allow_methods(methods, reset=False):
+ """See XXX"""
+
+ def write(string, flush=True):
+ """See XXX"""
+
+ def flush():
+ """See XXX"""
+
+ def set_content_length(len):
+ """See XXX"""
+
+ def sendfile(path, offset=0, len=-1):
+ """See XXX"""
+
+ # connection object
+ # readonly
+ connection = Attribute(
+ """See XXX"""
+ )
+
+ # server object
+ # readonly
+ server = Attribute(
+ """See XXX"""
+ )
+
+ headers_out = APRTable(
+ title=u"Headers to be sent to the client",
+ description=u"See XXX"
+ )
+
+ err_headers_out = APRTable(
+ title=u"Headers to be sent when an error occurs",
+ description=u"See XXX"
+ )
+
+ allowed = Int(
+ title=u"Bitvector of the allowed methods",
+ description=u"See XXX"
+ )
+
+ allowed_xmethods = Tuple(
+ title=u"Allowed extension methods",
+ description=u"See XXX",
+ #value_type???
+ readonly=True
+ )
+
+ allowed_methods = Tuple(
+ title=u"List of allowed methods",
+ description=u"See XXX",
+ value_type=BytesLine(),
+ readonly=True
+ )
+
+ sent_bodyct = Int(
+ title=u"Byte count in body stream", #?
+ description=u"See XXX",
+ readonly=True
+ )
+
+ bytes_sent = Int(
+ title=u"Number of bytes sent",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ content_type = BytesLine(
+ title=u"The content type",
+ description=u"See XXX",
+ )
+
+ status_line = TextLine(
+ title=u"Status Line",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ status = Int(
+ title=u"Status",
+ description=u"See XXX"
+ )
+
+ eos_sent = Bool(
+ title=u"EOS bucket sent",
+ description=u"See XXX",
+ readonly=True
+ )
+
+class IApacheRequest(Interface):
+ """Apache's request"""
+
+ def add_common_vars():
+ """See XXX"""
+
+ def get_basic_auth_pw():
+ """See XXX"""
+
+ def get_remote_host(type=None, str_is_ip=None):
+ """See XXX"""
+
+ def internal_redirect(new_uri):
+ """See XXX"""
+
+ def read(len=None):
+ """See XXX"""
+
+ def readline(len=None):
+ """See XXX"""
+
+ def readlines(sizehint=None):
+ """See XXX"""
+
+ # connection object
+ # readonly
+ connection = Attribute(
+ """See XXX"""
+ )
+
+ # server object
+ # readonly
+ server = Attribute(
+ """See XXX"""
+ )
+
+ # request object
+ # readonly
+ next = Attribute(
+ """See XXX"""
+ )
+
+ # request object
+ # readonly
+ prev = Attribute(
+ """See XXX"""
+ )
+
+ # request object
+ # readonly
+ main = Attribute(
+ """See XXX"""
+ )
+
+ the_request = TextLine(
+ title=u"First line of the request",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ assbackwards = Bool(
+ title=u"Indicates an HTTP/0.9 ``simple'' request",
+ description=u"See XXX"
+ )
+
+ proxyreq = Int(
+ title=u"A proxy request",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ header_only = Bool(
+ title=u"Indicates a HEAD only request",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ protocol = BytesLine(
+ title=u"Protocol, as given by the client",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ proto_num = Int(
+ title=u"Number of protocol version",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ hostname = TextLine(
+ title=u"Host, as set by full URI or header",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ request_time = Int(
+ title=u"Time when request was created",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ method = BytesLine(
+ title=u"Request method",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ method_number = Int(
+ title=u"Full method number",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ mtime = Int(
+ title=u"Time the resource was last modified",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ chunked = Bool(
+ title=u"Indicates chunked transfer-coding",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ range = BytesLine(
+ title=u"The Range: header",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ clength = Int(
+ title=u"The 'real' content length",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ remaining = Int(
+ title=u"Bytes left to read",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ read_length = Int(
+ title=u"Number of bytes read",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ read_body = Int(
+ title=u"How the request body should be read",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ read_chunked = Bool(
+ title=u"Read chunked transfer coding",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ expecting_100 = Bool(
+ title=u"Indicates an expected 100 (HTTP_CONTINUE) response",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ headers_in = APRTable(
+ title=u"Headers sent by the client",
+ description=u"See XXX"
+ )
+
+ # filled by add_common_vars()
+ subprocess_env = APRTable(
+ title=u"Environment information",
+ description=u"See XXX"
+ )
+
+ content_encoding = BytesLine(
+ description=u"See XXX",
+ readonly=True
+ )
+
+ vlist_validator = Int(
+ title=u"Variant list validator",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ user = BytesLine(
+ title=u"User name",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ ap_auth_type = Attribute(
+ """See XXX"""
+ )
+
+ no_cache = Bool(
+ title=u"No cache",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ no_local_copy = Bool(
+ title=u"No local copy exists",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ unparsed_uri = TextLine(
+ title=u"Unparsed URI",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ uri = TextLine(
+ title=u"Path portion of the URI",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ filename = TextLine(
+ title=u"File name",
+ description=u"See XXX",
+ )
+
+ canonical_filename = TextLine(
+ title=u"True filename",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ path_info = TextLine(
+ title=u"Path info",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ args = TextLine(
+ title=u"Query arguments",
+ description=u"See XXX",
+ readonly=True
+ )
+
+ finfo = Tuple(
+ title=u"File information structure",
+ description=u"See XXX",
+ readonly=True,
+ )
+
+ parsed_uri = Tuple(
+ title=u"Parsed URI",
+ description=u"See XXX",
+ readonly=True,
+ value_type=TextLine()
+ )
+
+ used_path_info = Bool(
+ title=u"Accept path_info",
+ description=u"See XXX",
+ readonly=True
+ )
Added: z3/modzope/trunk/src/modzope/app.py
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/src/modzope/app.py Wed Jun 16 17:01:56 2004
@@ -0,0 +1,82 @@
+##############################################################################
+#
+# Copyright (c) 2004 Philipp "philiKON" von Weitershausen
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Modzope application.
+
+$Id: app.py 218 2004-05-24 04:48:56Z philipp $
+"""
+from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.publisher.publish import publish as _publish
+
+import zope.app.appsetup
+import zope.app.debug
+import zope.app.event
+from zope.app.publication.browser import BrowserPublication
+
+class Application(object):
+ """Modzope application
+
+ The application takes care of ZCML configuration, database(s) and
+ publishing a request.
+ """
+
+ def __init__(self, db_file, config_file):
+ zope.app.appsetup.config(config_file)
+ # already publishes IDatabaseOpenedEvent
+ self.db = zope.app.appsetup.database(db_file)
+ zope.app.event.publish(None, zope.app.appsetup.ProcessStarting())
+
+ # XXX use IHTTPRequest, HTTPPublication as default?!?
+ def _request(self, context, request_type=IBrowserRequest,
+ publication=BrowserPublication):
+ pub = publication(self.db)
+ request = request_type(context)
+ request.setPublication(pub)
+ return request
+
+ def publish(self, context, *args, **kw):
+ #XXX take a few arguments more in order to decide which
+ # request/publication to use
+ request = self._request(context)
+
+ # _publish executes request.close() at which point the
+ # response is gone so, let's save it here.
+ response = request.response
+ _publish(request)
+ return response
+
+ def run(self, context, *args, **kw):
+ self.publish(context, *args, **kw)
+
+class DebugApplication(Application, zope.app.debug.Debugger):
+ """Application object useful for debugging"""
+
+_application = None
+
+def getApplication(context):
+ global _application
+ if _application is not None:
+ return _application
+
+ # waargh
+ import sys
+ sys.argv = []
+
+ import os.path
+ config = context.get_options()
+ sitepath = config.get('sitepath', '')
+ db = config.get('dbfile', os.path.join(sitepath, 'Data.fs'))
+ config_file = config.get('siteconfig', os.path.join(sitepath, 'site.zcml'))
+
+ _application = Application(db, config_file)
+ return _application
Added: z3/modzope/trunk/src/modzope/configure.zcml
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/src/modzope/configure.zcml Wed Jun 16 17:01:56 2004
@@ -0,0 +1,33 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:modzope="http://modzope.philikon.de/namespaces/zcml">
+
+ <include package="modzope.apache" />
+
+<!--
+
+ I think I might want to register those or similar request factories
+ to automate request/publication instanciation in
+ modzope.app.Application.
+
+ <startup:registerRequestFactory
+ name="HTTPRequestFactory"
+ factory="zope.app.publication.httpfactory"/>
+
+ <startup:registerRequestFactory
+ name="BrowserRequestFactory"
+ publication="zope.app.publication.browser.BrowserPublication"
+ request="zope.publisher.browser.BrowserRequest" />
+
+ <startup:registerRequestFactory
+ name="XMLRPCRequestFactory"
+ publication="zope.app.publication.xmlrpc.XMLRPCPublication"
+ request="zope.publisher.xmlrpc.XMLRPCRequest"/>
+
+ <startup:registerRequestFactory
+ name="FTPRequestFactory"
+ publication="zope.app.publication.ftp.FTPPublication"
+ request="zope.publisher.ftp.FTPRequest"/>
+-->
+
+</configure>
Added: z3/modzope/trunk/src/modzope/mod_python/__init__.py
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/src/modzope/mod_python/__init__.py Wed Jun 16 17:01:56 2004
@@ -0,0 +1 @@
+# make this directory a package
Added: z3/modzope/trunk/src/modzope/mod_python/handlers.py
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/src/modzope/mod_python/handlers.py Wed Jun 16 17:01:56 2004
@@ -0,0 +1,28 @@
+##############################################################################
+#
+# Copyright (c) 2004 Philipp "philiKON" von Weitershausen
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Modpython handlers
+
+$Id: handlers.py 219 2004-05-24 04:49:17Z philipp $
+"""
+import zope.interface
+
+from mod_python import apache
+from modzope.app import getApplication
+from modzope.mod_python.interfaces import IModPythonRequest
+
+def handler(req):
+ zope.interface.directlyProvides(req, IModPythonRequest)
+ app = getApplication(req)
+ response = app.publish(req)
+ return apache.OK
Added: z3/modzope/trunk/src/modzope/mod_python/interfaces.py
==============================================================================
--- (empty file)
+++ z3/modzope/trunk/src/modzope/mod_python/interfaces.py Wed Jun 16 17:01:56 2004
@@ -0,0 +1,36 @@
+##############################################################################
+#
+# Copyright (c) 2004 Philipp "philiKON" von Weitershausen
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Modpython interfaces
+
+$Id: interfaces.py 171 2004-05-01 15:04:32Z philipp $
+"""
+from zope.interface import Interface
+from zope.schema import BytesLine
+
+from modzope.apache.interfaces import IApacheRequest, IApacheResponse
+from modzope.apache.interfaces import IApacheConfig, IApacheProcess
+
+class IInterpreter(Interface):
+ """Give information about mod_python interpreter"""
+
+ interpreter = BytesLine(
+ title=u"Name of the current subinterpreter",
+ description=u"See XXX",
+ readonly=True
+ )
+
+class IModPythonRequest(IApacheRequest, IApacheResponse, IApacheConfig,
+ IApacheProcess, IInterpreter):
+ """Request object made available by mod_python, mostly based on
+ Apache's request struct."""
More information about the z3-checkins
mailing list