Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7)  |  Call(5)  |  Derive(0)  |  Import(2)
utility for deserializing LLSD data

The deserialization component is defined as a utility because the input
data can be a string or a file. It might be possible to define this as 
an adapter on a string but a string is too generic for this. So that's 
why it is a utility.

You can use it like this:

>>> s='<?xml version="1.0" ?><llsd><map><key>test</key><integer>1234</integer><key>foo</key><string>bar</string></map></llsd>'(more...)

src/p/y/pyogp.lib.base-0.1/pyogp/lib/base/caps.py   pyogp.lib.base(Download)
from pyogp.lib.base.exc import ResourceNotFound, ResourceError, DeserializerNotFound
from pyogp.lib.base.settings import Settings
from pyogp.lib.base.helpers import LLSDDeserializer, ListLLSDSerializer, DictLLSDSerializer
 
# initialize logging
        # ToDo: write a generic serializer/deserializer
        if (content_type == 'application/llsd+xml'):
            deserializer = LLSDDeserializer()
        else:
            raise DeserializerNotFound(content_type)
               (content_type == 'text/html' and \
                pattern.match(response.body) != None):
            deserializer = LLSDDeserializer()
        else:
            print response

src/p/y/pyogp.lib.base-0.1/pyogp/lib/base/tests/test_helpers.py   pyogp.lib.base(Download)
 
# pyogp
from pyogp.lib.base.helpers import Helpers, ListLLSDSerializer, DictLLSDSerializer, LLSDDeserializer
from pyogp.lib.base.exc import DataParsingError
 
    def test_LLSDDeserializer_deserialize(self):
 
        string = '<?xml version="1.0" ?><llsd><map><key>test</key><integer>1234</integer><key>foo</key><string>bar</string></map></llsd>'
 
        deserializer = LLSDDeserializer()
    def test_LLSDDeserializer_deserialize_string(self):
 
        string = '<?xml version="1.0" ?><llsd><map><key>test</key><integer>1234</integer><key>foo</key><string>bar</string></map></llsd>'
 
        deserializer = LLSDDeserializer()
    def test_LLSDDeserializer_deserialize_nonsense(self):
 
        data = ['<?xml version="1.0" ?><llsd><map><key>test</key><integer>1234</integer><key>foo</key><string>bar</string></map></llsd>']
 
        deserializer = LLSDDeserializer()