[Zope-CVS] CVS: Packages/Startup - datatypes.py:1.2 handlers.py:1.2 zopeschema.xml:1.2

Chris McDonough chrism@zope.com
Thu, 2 Jan 2003 11:41:45 -0500


Update of /cvs-repository/Packages/Startup
In directory cvs.zope.org:/tmp/cvs-serv11415

Modified Files:
	datatypes.py handlers.py zopeschema.xml 
Log Message:
Changes supporting chrism-install-branch.


=== Packages/Startup/datatypes.py 1.1.1.1 => 1.2 ===
--- Packages/Startup/datatypes.py:1.1.1.1	Wed Jan  1 06:05:40 2003
+++ Packages/Startup/datatypes.py	Thu Jan  2 11:41:12 2003
@@ -2,6 +2,15 @@
 
 from misc.factory import Factory
 
+def security_policy_implementation(value):
+    value = value.upper()
+    ok = ('PYTHON', 'C')
+    if value not in ok:
+        raise ValueError, (
+            "security_policy_implementation must be one of %s" % ok
+            )
+    return value
+
 def handler(section):
     formatter_klass, formatter_pos, formatter_kw = section.formatter
     handler_klass, handler_pos, handler_kw = section.constructor


=== Packages/Startup/handlers.py 1.1.1.1 => 1.2 ===
--- Packages/Startup/handlers.py:1.1.1.1	Wed Jan  1 06:05:40 2003
+++ Packages/Startup/handlers.py	Thu Jan  2 11:41:12 2003
@@ -128,6 +128,9 @@
     value is not None and _setenv('Z_REALM', value)
     return value
 
+def security_policy_implementation(value):
+    value not in ('C', None) and _setenv('ZOPE_SECURITY_POLICY', value)
+
 # server handlers
 
 class _SchemaHandler:
@@ -169,6 +172,21 @@
             server_type = section.__type__.name
             for server_factory in getattr(self, server_type)(section):
                 l.append((server_type, server_factory))
+
+        # if no servers are defined, create default http server and ftp server
+        if not l:
+            class dummy:
+                pass
+            http, ftp = dummy(), dummy()
+
+            http.ports = [('', 8080)]
+            http.force_connection_close = 0
+            ftp.ports = [('', 8021)]
+
+            http = self.http_server(http)[0]
+            ftp = self.ftp_server(ftp)[0]
+            l.extend([('http_server', http), ('ftp_server', ftp)])
+
         config.servers = l
 
         # set up defaults for zope_home and client_home if they're


=== Packages/Startup/zopeschema.xml 1.1.1.1 => 1.2 ===
--- Packages/Startup/zopeschema.xml:1.1.1.1	Wed Jan  1 06:05:41 2003
+++ Packages/Startup/zopeschema.xml	Thu Jan  2 11:41:12 2003
@@ -155,6 +155,10 @@
   <key name="automatically_quote_dtml_request_data" datatype="boolean"
      default="on" handler="automatically_quote_dtml_request_data"/>
 
+  <key name="security_policy_implementation"
+       datatype=".security_policy_implementation"
+       default="C" handler="security_policy_implementation"/>
+
   <key name="skip_authentication_checking" datatype="boolean"
      default="off" handler="skip_authentication_checking"/>