[Zodb-checkins] CVS: Zope3/src/ZConfig - loader.py:1.24
schema.py:1.27
Fred L. Drake, Jr.
fred at zope.com
Fri Oct 3 17:44:30 EDT 2003
Update of /cvs-repository/Zope3/src/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv18775
Modified Files:
loader.py schema.py
Log Message:
Identity components loaded by URL, not package name. This is needed to
allow a Python package to provide more than one component using different
file names, and allow more than one of them to be loaded into a single
schema.
=== Zope3/src/ZConfig/loader.py 1.23 => 1.24 ===
--- Zope3/src/ZConfig/loader.py:1.23 Fri Oct 3 16:01:56 2003
+++ Zope3/src/ZConfig/loader.py Fri Oct 3 17:43:59 2003
@@ -207,8 +207,6 @@
def importSchemaComponent(self, pkgname):
schema = self.schema
- if schema.hasComponent(pkgname):
- return
if not self._private_schema:
# replace the schema with an extended schema on the first %import
self._loader = SchemaLoader(self.schema.registry)
@@ -216,8 +214,10 @@
self._private_schema = True
self.schema = schema
url = self._loader.schemaComponentSource(pkgname, '')
+ if schema.hasComponent(url):
+ return
resource = self.openResource(url)
- schema.addComponent(pkgname)
+ schema.addComponent(url)
try:
ZConfig.schema.parseComponent(resource, self._loader, schema)
finally:
=== Zope3/src/ZConfig/schema.py 1.26 => 1.27 ===
--- Zope3/src/ZConfig/schema.py:1.26 Fri Oct 3 16:37:07 2003
+++ Zope3/src/ZConfig/schema.py Fri Oct 3 17:43:59 2003
@@ -305,7 +305,7 @@
self.error("file may not include a directory part")
if not self._schema.hasComponent(pkg):
src = self._loader.schemaComponentSource(pkg, file)
- self._schema.addComponent(pkg)
+ self._schema.addComponent(src)
self.loadComponent(src)
def loadComponent(self, src):
More information about the Zodb-checkins
mailing list