Package openid :: Package yadis :: Module etxrd
[frames | no frames]

Module openid.yadis.etxrd

ElementTree interface to an XRD document.
Function Summary
  expandService(service_element)
Take a service element and expand it into an iterator of: ([type_uri], uri, service_element)
  expandServices(service_elements)
Take a sorted iterator of service elements and expand it into a sorted iterator of: ([type_uri], uri, service_element)
unicode or None getCanonicalID(iname, xrd_tree)
Return the CanonicalID from this XRDS document.
  getPriority(element)
Get the priority of this element
  getPriorityStrict(element)
Get the priority of this element.
  getYadisXRD(xrd_tree)
Return the XRD element that should contain the Yadis services
  isXRDS(xrd_tree)
Is this document an XRDS document?
  iterServices(xrd_tree)
Return an iterable over the Service elements in the Yadis XRD
  mkXRDTag(t)
basestring -> basestring
  nsTag(ns, t)
  parseXRDS(text)
Parse the given text as an XRDS document.
  prioSort(elements)
Sort a list of elements that have priority attributes

Function Details

expandService(service_element)

Take a service element and expand it into an iterator of: ([type_uri], uri, service_element)

expandServices(service_elements)

Take a sorted iterator of service elements and expand it into a sorted iterator of: ([type_uri], uri, service_element)

There may be more than one item in the resulting list for each service element if there is more than one URI or type for a service, but each triple will be unique.

If there is no URI or Type for a Service element, it will not appear in the result.

getCanonicalID(iname, xrd_tree)

Return the CanonicalID from this XRDS document.
Parameters:
iname - the XRI being resolved.
           (type=unicode)
xrd_tree - The XRDS output from the resolver.
           (type=ElementTree)
Returns:
The XRI CanonicalID or None.
           (type=unicode or None)

getPriority(element)

Get the priority of this element

Returns Max if no priority is specified or the priority value is invalid.

getPriorityStrict(element)

Get the priority of this element.

Raises ValueError if the value of the priority is invalid. If no priority is specified, it returns a value that compares greater than any other value.

getYadisXRD(xrd_tree)

Return the XRD element that should contain the Yadis services

isXRDS(xrd_tree)

Is this document an XRDS document?

iterServices(xrd_tree)

Return an iterable over the Service elements in the Yadis XRD

sorted by priority

mkXRDTag(t)

basestring -> basestring

Create a tag name in the XRD 2.0 XML namespace suitable for using with ElementTree

parseXRDS(text)

Parse the given text as an XRDS document.
Returns:
ElementTree containing an XRDS document
Raises:
XRDSError - When there is a parse error or the document does not contain an XRDS.

prioSort(elements)

Sort a list of elements that have priority attributes

Generated by Epydoc 2.1 on Fri Dec 14 16:10:52 2007 http://epydoc.sf.net