Package amplee :: Package atompub :: Package member :: Module helper :: Class MemberHelper
[hide private]
[frames] | no frames]

Class MemberHelper

source code

object --+
         |
        MemberHelper

Instance Methods [hide private]
  __init__(self, collection)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature...
  initiate(self, id)
Creates a default Atom entry document with its id, published, updated and edited children set.
  add_element(self, name, content=None, attributes=None, prefix=None, ns=None, parent=None)
...
  copy_element(self, name, source=None, destination=None, ns=None)
...
  copy_elements(self, name, source=None, destination=None, ns=None)
...

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, collection)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

initiate(self, id)

source code 

Creates a default Atom entry document with its id, published, updated and
edited children set. If the collection has a xml_base attribute set it will
also set it.

Keyword argument:
id -- the identifier of the entry (unicode)

add_element(self, name, content=None, attributes=None, prefix=None, ns=None, parent=None)

source code 

Add a child to an element

Keyword arguments:
name -- name of the element
content -- content of the element
attributes -- dictionnary of attributes to set
prefix -- XML prefix (if not provided defaults to self.entry.xml_prefix)
ns -- XML namespace (if not provided defaults to self.entry.xml_ns)
parent -- if provided the child will be attached to parent,
otherwiseparent will default to self.entry

copy_element(self, name, source=None, destination=None, ns=None)

source code 

Copy an element into another element

Keyword arguments:
name -- name of the element to copy
source -- element containing a child 'name'
destination -- element to which attached the copy
ns -- XML namespace to match (if not provided defaults to self.entry.xml_ns)

copy_elements(self, name, source=None, destination=None, ns=None)

source code 

Copy a list of elements into another element

Keyword arguments:
name -- name of the element to copy
source -- element containing a child 'name'
destination -- element to which attached the copy
ns -- XML namespace to match (if not provided defaults to self.entry.xml_ns)