From 1d2817844ed94e13899f12f1a9e6d718b7d1cb8b Mon Sep 17 00:00:00 2001 From: jortel Date: Thu, 6 May 2010 21:53:31 +0000 Subject: Update epydocs suds/xsd/schema.py --- suds/mx/literal.py | 5 ++++- suds/xsd/schema.py | 18 ++++++++++++++---- suds/xsd/sxbase.py | 13 ++++++++++++- suds/xsd/sxbasic.py | 6 ++++++ tests/rhq.py | 4 ++-- 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/suds/mx/literal.py b/suds/mx/literal.py index 937ad8e..b6c0c7e 100644 --- a/suds/mx/literal.py +++ b/suds/mx/literal.py @@ -143,7 +143,10 @@ class Typed(Core): # by the schema (elementFormDefault). # ns = content.type.namespace() - if content.type.form_qualified: + qualify = \ + ( content.type.form_qualified or + content.type.element() == 1) + if qualify: node = Element(content.tag, ns=ns) node.addPrefix(ns[0], ns[1]) else: diff --git a/suds/xsd/schema.py b/suds/xsd/schema.py index a22f1c5..4194673 100644 --- a/suds/xsd/schema.py +++ b/suds/xsd/schema.py @@ -166,16 +166,26 @@ class Schema: @type baseurl: str @ivar container: A schema collection containing this schema. @type container: L{SchemaCollection} - @ivar types: A schema types cache. - @type types: {name:L{SchemaObject}} - @ivar groups: A schema groups cache. - @type groups: {name:L{SchemaObject}} @ivar children: A list of direct top level children. @type children: [L{SchemaObject},...] + @ivar all: A children. + @type all: [L{SchemaObject},...] + @ivar groups: A schema groups cache. + @type groups: {name:L{SchemaObject}} @ivar all: A list of all (includes imported) top level children. @type all: [L{SchemaObject},...] + @ivar types: A schema types cache. + @type types: {name:L{SchemaObject}} @ivar imports: A list of import objects. @type imports: [L{SchemaObject},...] + @ivar elements: A list of objects. + @type elements: [L{SchemaObject},...] + @ivar attributes: A list of objects. + @type attributes: [L{SchemaObject},...] + @ivar groups: A list of group objects. + @type groups: [L{SchemaObject},...] + @ivar agrps: A list of attribute group objects. + @type agrps: [L{SchemaObject},...] @ivar form_qualified: The flag indicating: (@elementFormDefault). @type form_qualified: bool diff --git a/suds/xsd/sxbase.py b/suds/xsd/sxbase.py index 1c0ba64..62c2d7f 100644 --- a/suds/xsd/sxbase.py +++ b/suds/xsd/sxbase.py @@ -218,10 +218,21 @@ class SchemaObject(object): """ return self.cache.get(nobuiltin, self) + def element(self): + """ + Get whether this is an + @return: code. + - 0=not an element + - 1=root, + - 2=non-root + @rtype: int + """ + return 0 + def sequence(self): """ Get whether this is an - @return: True if any, else False + @return: True if , else False @rtype: boolean """ return False diff --git a/suds/xsd/sxbasic.py b/suds/xsd/sxbasic.py index 0b536d2..d6a43af 100644 --- a/suds/xsd/sxbasic.py +++ b/suds/xsd/sxbasic.py @@ -387,6 +387,12 @@ class Element(TypedContent): def childtags(self): return ('attribute', 'simpleType', 'complexType', 'any',) + def element(self): + if self in self.schema.children: + return 1 + else: + return 2 + def extension(self): for c in self.rawchildren: if c.extension(): diff --git a/tests/rhq.py b/tests/rhq.py index ca810e6..2b755d1 100644 --- a/tests/rhq.py +++ b/tests/rhq.py @@ -34,7 +34,7 @@ errors = 0 setup_logging() -#logging.getLogger('suds.client').setLevel(logging.DEBUG) +logging.getLogger('suds.client').setLevel(logging.DEBUG) #logging.getLogger('suds.metrics').setLevel(logging.DEBUG) #logging.getLogger('suds').setLevel(logging.DEBUG) @@ -51,7 +51,7 @@ def rhqTest(): url = 'http://localhost.localdomain:7080/rhq-rhq-enterprise-server-ejb3/WebservicesManagerBean?wsdl' start(url) - client = Client(url, cache=None) + client = Client(url) print client try: -- cgit v1.2.1