From 06132c466a1a6e44f82525599e379b18d67afc87 Mon Sep 17 00:00:00 2001 From: Joshua Boverhof Date: Mon, 27 Oct 2003 22:42:02 +0000 Subject: [PATCH] ---------------------------------------------------------------------- Modified Files: Utility.py WSDLTools.py XMLSchema.py -- Fixed [ 810251 ] default method broken in wstools.Utility.Collection -- Also fixed problem with includes Collection key, and changed Types(Collection) class to declare a different default key instead of redefining several methods. ---------------------------------------------------------------------- --- Utility.py | 2 +- WSDLTools.py | 7 +------ XMLSchema.py | 3 ++- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Utility.py b/Utility.py index 5e07651..482be99 100755 --- a/Utility.py +++ b/Utility.py @@ -557,7 +557,7 @@ DOM = DOM() class Collection(UserDict): """Helper class for maintaining ordered named collections.""" - default = lambda k: k.name + default = lambda self,k: k.name def __init__(self, parent, key=None): UserDict.__init__(self) self.parent = weakref.ref(parent) diff --git a/WSDLTools.py b/WSDLTools.py index f31ff44..442762d 100755 --- a/WSDLTools.py +++ b/WSDLTools.py @@ -288,6 +288,7 @@ class ImportElement(Element): class Types(Collection): + default = lambda self,k: k.targetNamespace def __init__(self, parent): Collection.__init__(self, parent) self.documentation = '' @@ -298,12 +299,6 @@ class Types(Collection): self[name] = schema return schema - def keys(self): - return map(lambda i: i.targetNamespace, self.list) - - def items(self): - return map(lambda i: i.targetNamespace, self.list) - def addExtension(self, item): self.extensions.append(item) diff --git a/XMLSchema.py b/XMLSchema.py index ff9c2b0..9344a05 100755 --- a/XMLSchema.py +++ b/XMLSchema.py @@ -824,7 +824,8 @@ class XMLSchema(XMLSchemaComponent): XMLSchemaComponent.__init__(self, parent) f = lambda k: k.attributes['name'] ns = lambda k: k.attributes['namespace'] - self.includes = Collection(self, key=f) + sl = lambda k: k.attributes['schemaLocation'] + self.includes = Collection(self, key=sl) self.imports = Collection(self, key=ns) self.elements = Collection(self, key=f) self.types = Collection(self, key=f)