SVN: zpkgtools/branches/fdrake-zconfig-branch/zpkgsetup/cfgparser.py avoid API that is not used

"Fred L. Drake, Jr." <[email protected]>
Newsgroups gmane.comp.web.zope.public-cvs
Message-ID <[email protected]>
Log message for revision 38174:
  avoid API that is not used

Changed:
  U   zpkgtools/branches/fdrake-zconfig-branch/zpkgsetup/cfgparser.py

-=-
Modified: zpkgtools/branches/fdrake-zconfig-branch/zpkgsetup/cfgparser.py
===================================================================
--- zpkgtools/branches/fdrake-zconfig-branch/zpkgsetup/cfgparser.py	2005-08-30 21:18:59 UTC (rev 38173)
+++ zpkgtools/branches/fdrake-zconfig-branch/zpkgsetup/cfgparser.py	2005-08-30 21:25:06 UTC (rev 38174)
@@ -16,7 +16,8 @@
 
 # This is new:
 
-def cachedSchemaLoader(filename="schema.xml", package=None):
+def cachedSchemaLoader(filename="schema.xml", package=None,
+                       loader_factory=None):
     if package is None:
         frame = sys._getframe(1)
         __path__ = _get_path_from_frame(frame)
@@ -26,6 +27,8 @@
         __import__(package)
         __path__ = sys.modules[package].__path__
 
+    if loader_factory is None:
+        loader_factory = SchemaLoader
     cache = []
     def loadSchemaCache():
         if cache:
@@ -33,7 +36,7 @@
         for p in __path__:
             path = os.path.join(p, filename)
             if os.path.isfile(path):
-                schema = loadSchema(path)
+                schema = loader_factory().loadURL(path)
                 cache.append(schema)
                 return schema
         raise ValueError("could not locate schema %r for package %r (path=%r)"
@@ -63,12 +66,6 @@
 
 
 
-def loadSchema(url):
-    return SchemaLoader().loadURL(url)
-
-def loadSchemaFile(file, url=None):
-    return SchemaLoader().loadFile(file, url)
-
 def loadConfig(schema, url, overrides=()):
     return _get_config_loader(schema, overrides).loadURL(url)
 

_______________________________________________
Zope-CVS maillist  -  [email protected]
http://mail.zope.org/mailman/listinfo/zope-cvs

Zope CVS instructions: http://dev.zope.org/CVS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.