Package suds :: Module resolver :: Class PathResolver
[hide private]
[frames] | no frames]

Class PathResolver

source code

Resolver --+
           |
          PathResolver

Resolveds the definition object for the schema type located at the specified path. The path may contain (.) dot notation to specify nested types.

Nested Classes [hide private]
  BadPath
Instance Methods [hide private]
 
__init__(self, wsdl, ps='.') source code
xsd.sxbase.SchemaObject
find(self, path, resolved=True)
Get the definition object for the schema type located at the specified path.
source code
xsd.sxbase.SchemaObject
root(self, parts)
Find the path root.
source code
xsd.sxbase.SchemaObject
branch(self, root, parts)
Traverse the path until the leaf is reached.
source code
xsd.sxbase.SchemaObject
leaf(self, parent, parts)
Find the leaf.
source code
qname
qualify(self, name)
Qualify the name as either:
source code
[str,..]
split(self, s)
Split the string on (.) while preserving any (.) inside the '{}' alternalte syntax for full ns qualification.
source code
Instance Variables [hide private]
wsdl.Definitions wsdl
A wsdl object.

Inherited from Resolver: schema

Method Details [hide private]

__init__(self, wsdl, ps='.')
(Constructor)

source code 
Parameters:
  • wsdl (wsdl.Definitions) - A schema object.
  • ps (char) - The path separator character
Overrides: Resolver.__init__

find(self, path, resolved=True)

source code 

Get the definition object for the schema type located at the specified path. The path may contain (.) dot notation to specify nested types. Actually, the path separator is usually a (.) but can be redefined during contruction.

Parameters:
  • path (basestring) - A (.) separated path to a schema type.
  • resolved (boolean) - A flag indicating that the fully resolved type should be returned.
Returns: xsd.sxbase.SchemaObject
The found schema type
Overrides: Resolver.find

root(self, parts)

source code 

Find the path root.

Parameters:
  • parts ([str,..]) - A list of path parts.
Returns: xsd.sxbase.SchemaObject
The root.

branch(self, root, parts)

source code 

Traverse the path until the leaf is reached.

Parameters:
Returns: xsd.sxbase.SchemaObject
The end of the branch.

leaf(self, parent, parts)

source code 

Find the leaf.

Parameters:
Returns: xsd.sxbase.SchemaObject
The leaf.

qualify(self, name)

source code 

Qualify the name as either:

  • plain name
  • ns prefixed name (eg: ns0:Person)
  • fully ns qualified name (eg: {http://myns-uri}Person)
Parameters:
  • name (str) - The name of an object in the schema.
Returns: qname
A qualifed name.

split(self, s)

source code 

Split the string on (.) while preserving any (.) inside the '{}' alternalte syntax for full ns qualification.

Parameters:
  • s (str) - A plain or qualifed name.
Returns: [str,..]
A list of the name's parts.