[Zope3-checkins] CVS: StandaloneZConfig/ZConfig/scripts - zconfig:1.6

Fred L. Drake, Jr. fred at zope.com
Tue Jan 27 13:09:15 EST 2004


Update of /cvs-repository/StandaloneZConfig/ZConfig/scripts
In directory cvs.zope.org:/tmp/cvs-serv10354

Modified Files:
	zconfig 
Log Message:
- update to reflect removal of the "classic" ZConfig support
  (this was removed a few months ago)


=== StandaloneZConfig/ZConfig/scripts/zconfig 1.5 => 1.6 ===
--- StandaloneZConfig/ZConfig/scripts/zconfig:1.5	Tue Jul 22 12:29:50 2003
+++ StandaloneZConfig/ZConfig/scripts/zconfig	Tue Jan 27 13:09:13 2004
@@ -25,10 +25,11 @@
     --help          Print this help text.
 
     -s file
-    --schema file   Use the schema in 'file' to validate the configuration.
+    --schema file   Use the schema in 'file' to validate the configuration;
+                    this must be specified.
 
 Each file named on the command line is checked for syntactical errors
-and schema conformance (when the schema is specified).  If no files
+and schema conformance.  The schema must be specified.  If no files
 are specified and standard input is not a TTY, standard in is treated
 as a configuration file.  Specifying a schema and no configuration
 files causes the schema to be checked.
@@ -39,12 +40,11 @@
 import sys
 
 import ZConfig
-import ZConfig.Context
 import ZConfig.loader
 
 
 def main():
-    loader = ClassicLoader()
+    loader = None
     schema = None
     try:
         opts, args = getopt.getopt(sys.argv[1:], "hs:", ["help", "schema="])
@@ -65,6 +65,11 @@
                 return 1
             loader = ZConfig.loader.ConfigLoader(schema)
 
+    if loader is None:
+        print >>sys.stderr, "No schema specified, but is required."
+        usage(sys.stderr)
+        return 2
+
     if not args:
         if sys.stdin.isatty():
             if schema:
@@ -95,13 +100,6 @@
 
 def usage(fp):
     print >>fp, __doc__
-
-
-class ClassicLoader(ZConfig.Context.Context):
-    def loadResource(self, resource):
-        # create a temporary context since it's not reusable
-        context = ZConfig.Context.Context()
-        return context.loadResource(resource)
 
 
 if __name__ == "__main__":




More information about the Zope3-Checkins mailing list