Package twisted :: Package persisted :: Module marmalade

[frames | no frames]

## Module twisted.persisted.marmalade

Marmalade: jelly, with just a hint of bitterness.

I can serialize a Python object to an XML DOM tree (twisted.web.microdom), and therefore to XML data, similarly to twisted.spread.jelly. Because both Python lists and DOM trees are tree data-structures, many of the idioms used here are identical.

Classes
`DOMJellier` |
`DOMJellyable` |
`DOMUnjellier` |

Function Summary
| ``getValueElement`(node)` Get the one child element of a given element.
| `instance(klass, d)`
| ``jellyToDOM`(object)` Convert an Object into an twisted.web.microdom.Document.
| ``jellyToXML`(object, file)` jellyToXML(object, [file]) -> None | string
| ``unjellyFromDOM`(document)` Convert an twisted.web.microdom.Document into a Python object.
| ``unjellyFromXML`(stringOrFile)` I convert a string or the contents of an XML file into a Python object.

Function Details

### getValueElement(node)

Get the one child element of a given element.

If there is more than one child element, raises ValueError. Otherwise, returns the value element.

### jellyToDOM(object)

Convert an Object into an twisted.web.microdom.Document.

### jellyToXML(object, file=None)

jellyToXML(object, [file]) -> None | string

Converts a Python object to an XML stream. If you pass a file, the XML will be written to that file; otherwise, a string of the XML will be returned.

### unjellyFromDOM(document)

Convert an twisted.web.microdom.Document into a Python object.

### unjellyFromXML(stringOrFile)

I convert a string or the contents of an XML file into a Python object.

Generated by Epydoc 2.0 on Sat May 15 20:08:06 2004 | http://epydoc.sf.net