[Zope-CVS] CVS: Packages/autotester - autotest.py:1.7

Fred L. Drake, Jr. fred at zope.com
Thu Oct 2 14:38:29 EDT 2003


Update of /cvs-repository/Packages/autotester
In directory cvs.zope.org:/tmp/cvs-serv22992

Modified Files:
	autotest.py 
Log Message:
add -X to support ZConfig command line overrides


=== Packages/autotester/autotest.py 1.6 => 1.7 ===
--- Packages/autotester/autotest.py:1.6	Fri Sep 26 08:15:27 2003
+++ Packages/autotester/autotest.py	Thu Oct  2 14:38:28 2003
@@ -230,12 +230,15 @@
     if args is None:
         args = sys.argv[1:]
 
+    overrides = []
     unitname = None
-    opts, args = getopt.getopt(args, "tu:", ["testing","unit="])
+    opts, args = getopt.getopt(args, "tu:X:", ["testing", "unit="])
     for opt, val in opts:
         if opt in ("-t", "--testing"):
             TESTING = True
-        if opt in ("-u", "--unit"):
+        elif opt == "-X":
+            overrides.append(val)
+        elif opt in ("-u", "--unit"):
             unitname = val
             
     if len(args) > 1:
@@ -250,7 +253,7 @@
     schemapath = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
                               "autotest.xml")
     schema = ZConfig.loadSchema(schemapath)
-    config, _ = ZConfig.loadConfig(schema, configpath)
+    config, _ = ZConfig.loadConfig(schema, configpath, overrides=overrides)
 
     found = 0
     for u in config.units:




More information about the Zope-CVS mailing list