[Zope3-checkins] CVS: Zope3 - zope.conf.in:1.1.2.1 .cvsignore:1.7.34.1 z3.py:1.19.4.1 principals.zcml.in:NONE zserver.zcml.in:NONE

Fred L. Drake, Jr. fred@zope.com
Mon, 23 Jun 2003 18:08:26 -0400


Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv24536

Modified Files:
      Tag: fdrake-zconfig-in-zope-3-branch
	.cvsignore z3.py 
Added Files:
      Tag: fdrake-zconfig-in-zope-3-branch
	zope.conf.in 
Removed Files:
      Tag: fdrake-zconfig-in-zope-3-branch
	principals.zcml.in zserver.zcml.in 
Log Message:
Support ZConfig in Zope 3.

=== Added File Zope3/zope.conf.in ===
# identify the component configuration used to define the site:
site-definition 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>

<zodb>
  <filestorage>
    path Data.fs
  </filestorage>
</zodb>

<eventlog>
  <logfile>
    path z3.log
  </logfile>
</eventlog>


=== Zope3/.cvsignore 1.7 => 1.7.34.1 ===
--- Zope3/.cvsignore:1.7	Thu Dec 19 18:04:17 2002
+++ Zope3/.cvsignore	Mon Jun 23 18:07:55 2003
@@ -7,3 +7,4 @@
 dist
 coverage
 z3.log
+site.conf


=== Zope3/z3.py 1.19 => 1.19.4.1 ===
--- Zope3/z3.py:1.19	Wed Jun 11 16:12:32 2003
+++ Zope3/z3.py	Mon Jun 23 18:07:55 2003
@@ -17,93 +17,43 @@
 $Id$
 """
 
-import os, sys, time, getopt
+import os
+import sys
 
-basepath = filter(None, sys.path)
 
-def run(argv=sys.argv):
+basepath = filter(None, sys.path)
 
-    
-    
-    # Record start times (real time and CPU time)
-    t0 = time.time()
-    c0 = time.clock()
+def run(argv=list(sys.argv)):
 
     # Refuse to run without principals.zcml
     if not os.path.exists('principals.zcml'):
-        print """ERROR: You need to create 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 principals.zcml.in and then look at
         sample_principals.zcml for some example principal and role
-        settings."""
+        settings.
+        """
         sys.exit(1)
 
     # setting python paths
-    program = argv.pop(0)
-    if argv == ['--build']:
+    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'
+        src = 'src'
 
-    
     here = os.path.join(os.getcwd(), os.path.split(program)[0])
     srcdir = os.path.abspath(src)
     sys.path = [srcdir, here] + basepath
 
-    # Initialize the logging module.
-    import logging.config
-    logging.basicConfig()
-    # See zope/app/startup/sitedefinition.py for this default:
-    logging.root.setLevel(logging.INFO)
-    # If log.ini exists, use it
-    if os.path.exists("log.ini"):
-        logging.config.fileConfig("log.ini")
-
-    # temp hack
-    dir = os.getcwd()
-
-    # Copy products.zcml.in, if necessary
-    if (not os.path.exists('products.zcml')
-        and os.path.exists('products.zcml.in')
-        ):
-        cfin = open('products.zcml.in')
-        cfout = open('products.zcml', 'w')
-        cfout.write(cfin.read())
-        cfout.close(); cfin.close()
-
-    # Do global software config
-    from zope.app import config
-    config('site.zcml')
-
-    # Load server config
-    if (not os.path.exists('zserver.zcml')
-        and os.path.exists('zserver.zcml.in')
-        ):
-        cfin = open('zserver.zcml.in')
-        cfout = open('zserver.zcml', 'w')
-        cfout.write(cfin.read())
-        cfout.close(); cfin.close()
-
-    from zope.configuration.xmlconfig import XMLConfig
-    XMLConfig(os.path.join(dir, 'zserver.zcml'))()
-
-    from zodb.zeo import threadedasync
-
-    # Report total startup time
-    t1 = time.time()
-    c1 = time.clock()
-    logging.info("Startup time: %.3f sec real, %.3f sec CPU", t1-t0, c1-c0)
-
-    try:
-        threadedasync.loop()
-    except KeyboardInterrupt:
-        # Exit without spewing an exception.
-        pass
-    sys.exit(0)
+    from zope.app.process.main import main
+    main(argv[1:])
 
 
 if __name__ == '__main__':

=== Removed File Zope3/principals.zcml.in ===

=== Removed File Zope3/zserver.zcml.in ===