Example #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)
Example #2
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)
def dump(obj, fp, app=None, **kwargs):
    """Like :func:`dumps` but writes into a app.ini object."""
    _dump_arg_defaults(kwargs, app=app)
    encoding = kwargs.pop("encoding", None)
    if encoding is not None:
        fp = _wrap_writer_for_text(fp, encoding)
    _json.dump(obj, fp, **kwargs)
Example #4
0
def dump(obj, fp, **kwargs):
    """类似 :func:`dumps` 函数,但写成了一个文件对象."""
    _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)
Example #5
0
File: json.py Project: avdd/flak
def _dump(obj, fp, **kw):
    encoding = kw.pop('encoding', None)
    if encoding is not None:
        fp = _wrap_writer_for_text(fp, encoding)
    _json.dump(obj, fp, **kw)