Exemplo n.º 1
0
def dump(obj, fp, **kwargs):
    """Like :func:`dumps` but writes into a file object."""
    _dump_arg_defaults(kwargs)
    encoding = kwargs.pop('encoding', None)
    if encoding is not None:
        fp = _wrap_writer_for_text(fp, encoding)
    _json.dump(obj, fp, **kwargs)
Exemplo n.º 2
0
def dump(obj, fp, **kwargs):
    """Like :func:`dumps` but writes into a file object."""
    _dump_arg_defaults(kwargs)
    return _json.dump(obj, fp, **kwargs)
Exemplo n.º 3
0
def dump(obj, fp, **kwargs):
    """Like :func:`dumps` but writes into a file object."""
    _dump_arg_defaults(kwargs)
    return _json.dump(obj, fp, **kwargs)
Exemplo n.º 4
0
def dump(obj, fp, **kwargs):
    """Like :func:`dumps` but writes into a file object."""
    if current_app:
        kwargs.setdefault('cls', current_app.json_encoder)
    return _json.dump(obj, fp, **kwargs)
Exemplo n.º 5
0
Arquivo: json.py Projeto: Freso/flask
def dump(obj, fp, **kwargs):
    """Like :func:`dumps` but writes into a file object."""
    if current_app:
        kwargs.setdefault('cls', current_app.json_encoder)
    return _json.dump(obj, fp, **kwargs)
Exemplo n.º 6
0
def dump(obj, fp, **kwargs):
    _dump_arg_defaults(kwargs)
    encoding = kwargs.pop('encoding', None)
    if encoding is not None:
        fp = _wrap_writer_for_text(fp, encoding)
    _json.dump(obj, fp, **kwargs)