[Zope3-checkins] SVN: Zope3/branches/3.2/src/zope/app/server/ Added a --zserver option to mkzopeinstance to create a server that

Jim Fulton jim at zope.com
Fri Dec 16 15:09:54 EST 2005


Log message for revision 40828:
  Added a --zserver option to mkzopeinstance to create a server that
  uses the older ZServer network server.
  

Changed:
  U   Zope3/branches/3.2/src/zope/app/server/mkzopeinstance.py
  U   Zope3/branches/3.2/src/zope/app/server/tests/test_mkzopeinstance.py
  A   Zope3/branches/3.2/src/zope/app/server/zopeskel/
  A   Zope3/branches/3.2/src/zope/app/server/zopeskel/bin/
  A   Zope3/branches/3.2/src/zope/app/server/zopeskel/bin/debugzope.in
  A   Zope3/branches/3.2/src/zope/app/server/zopeskel/bin/runzope.in
  A   Zope3/branches/3.2/src/zope/app/server/zopeskel/bin/zopectl.in
  A   Zope3/branches/3.2/src/zope/app/server/zopeskel/etc/
  A   Zope3/branches/3.2/src/zope/app/server/zopeskel/etc/zope.conf.in

-=-
Modified: Zope3/branches/3.2/src/zope/app/server/mkzopeinstance.py
===================================================================
--- Zope3/branches/3.2/src/zope/app/server/mkzopeinstance.py	2005-12-16 19:59:55 UTC (rev 40827)
+++ Zope3/branches/3.2/src/zope/app/server/mkzopeinstance.py	2005-12-16 20:09:54 UTC (rev 40828)
@@ -31,8 +31,8 @@
 
 from zope.app.authentication import password
 from zope.app.applicationcontrol import zopeversion
+import zope.app.server
 
-
 def main(argv=None, from_checkout=False):
     """Top-level script function to create a new Zope instance."""
     if argv is None:
@@ -220,6 +220,13 @@
             ("<<SOFTWARE_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
@@ -296,6 +303,17 @@
                  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

Modified: Zope3/branches/3.2/src/zope/app/server/tests/test_mkzopeinstance.py
===================================================================
--- Zope3/branches/3.2/src/zope/app/server/tests/test_mkzopeinstance.py	2005-12-16 19:59:55 UTC (rev 40827)
+++ Zope3/branches/3.2/src/zope/app/server/tests/test_mkzopeinstance.py	2005-12-16 20:09:54 UTC (rev 40828)
@@ -20,6 +20,7 @@
 import sys
 import tempfile
 import unittest
+import zope.app.server
 
 from StringIO import StringIO
 
@@ -187,6 +188,35 @@
         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
+        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'))
+                     )
+        self.assert_('from zope.app.server.main import debug' in
+                     open(os.path.join(self.instance, 'bin', 'debugzope'))
+                     )
+        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

Copied: Zope3/branches/3.2/src/zope/app/server/zopeskel/bin/debugzope.in (from rev 40815, Zope3/branches/Zope-3.1/zopeskel/bin/debugzope.in)

Copied: Zope3/branches/3.2/src/zope/app/server/zopeskel/bin/runzope.in (from rev 40815, Zope3/branches/Zope-3.1/zopeskel/bin/runzope.in)

Copied: Zope3/branches/3.2/src/zope/app/server/zopeskel/bin/zopectl.in (from rev 40815, Zope3/branches/Zope-3.1/zopeskel/bin/zopectl.in)

Copied: Zope3/branches/3.2/src/zope/app/server/zopeskel/etc/zope.conf.in (from rev 40816, Zope3/branches/Zope-3.1/zopeskel/etc/zope.conf.in)
===================================================================
--- Zope3/branches/Zope-3.1/zopeskel/etc/zope.conf.in	2005-12-16 17:35:57 UTC (rev 40816)
+++ Zope3/branches/3.2/src/zope/app/server/zopeskel/etc/zope.conf.in	2005-12-16 20:09:54 UTC (rev 40828)
@@ -0,0 +1,91 @@
+# This is the configuration file for the Zope Application Server.
+
+%define INSTANCE  <<INSTANCE_HOME>>
+
+%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
+
+<server>
+  type HTTP
+  address 8080
+</server>
+
+# 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.
+#
+#<server>
+#  type PostmortemDebuggingHTTP
+#  address 8080
+#</server>
+
+# uncomment this if you want the FTP server up and running
+#<server fttp>
+#  type FTP
+#  address 8021
+#</server>
+
+# Standard Filestorage
+<zodb>
+  <filestorage>
+    path $DATADIR/Data.fs
+  </filestorage>
+
+# uncomment this if you want to connect to a local ZEO server
+# instead:
+#  <zeoclient>
+#    server localhost:9999
+#    storage 1
+#    # ZEO client cache, in bytes
+#    cache-size 20MB
+#    # Uncomment to have a persistent disk cache
+#    #client zeo1
+#  </zeoclient>
+</zodb>
+
+<accesslog>
+  # 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.
+
+  <logfile>
+    path $LOGDIR/access.log
+  </logfile>
+
+  <logfile>
+    path STDOUT
+  </logfile>
+</accesslog>
+
+<eventlog>
+  # 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.
+
+  <logfile>
+    path $LOGDIR/z3.log
+  </logfile>
+
+  <logfile>
+    path STDOUT
+  </logfile>
+</eventlog>
+
+# devmode
+#
+#   Switches the Developer Mode on and off.
+#
+# Default:
+#   devmode on
+#
+#devmode off



More information about the Zope3-Checkins mailing list