Example #1
0
def iloads(text, mode="safe", errto=None, json=0):
    '''\
    Iterative loading values from unicode text.

    :param text:
        Unicode text.

    :param mode:
        Specifies the method of building python objects for complex values
        (see .. py:func:`load`)

    :param errto:
        Name of file for reporting errors

    :param json:
        If true then allow JSON encoded parts.

    :returns:
        Iterator object. It returns values during iteration.
    '''
    text = as_unicode(text)
    fd = StringReader(text)

    loader = Loader(fd, mode, errto, json)
    for val in loader.iload():
        yield val
Example #2
0
def iloads(text, mode="safe", errto=None, json=0):
    '''\
    Iterative loading values from unicode text.

    :param text:
        Unicode text.

    :param mode:
        Specifies the method of building python objects for complex values
        (see .. py:func:`load`)

    :param errto:
        Name of file for reporting errors

    :param json:
        If true then allow JSON encoded parts.

    :returns:
        Iterator object. It returns values during iteration.
    '''
    text = as_unicode(text)
    fd = StringReader(text)

    loader = Loader(fd, mode, errto, json)
    for val in loader.iload():
        yield val
Example #3
0
def loads(text, mode="safe", errto=None, json=0):
    '''\
    Load values from unicode text.

    :param text:
        Unicode text.

    :param mode:
        Specifies the method of building python objects for complex values
        (see .. py:func:`load`)

    :param errto:
        Name of file for reporting errors

    :param json:
        If true then allow JSON encoded parts.

    :returns:
        List of values.
    '''
    text = as_unicode(text)
    fd = StringReader(text)

    loader = Loader(fd, mode, errto, json)
    return loader.load()
Example #4
0
def loads(text, mode="safe", errto=None, json=0):
    '''\
    Load values from unicode text.

    :param text:
        Unicode text.

    :param mode:
        Specifies the method of building python objects for complex values
        (see .. py:func:`load`)

    :param errto:
        Name of file for reporting errors

    :param json:
        If true then allow JSON encoded parts.

    :returns:
        List of values.
    '''
    text = as_unicode(text)
    fd = StringReader(text)

    loader = Loader(fd, mode, errto, json)
    return loader.load()