예제 #1
0
def dump(obj, path, protocol=0):
    """Dump a binary representation of obj to the file, path"""

    contents = dumps(obj)
    fd = LocalFile(path, "w")
    fd.write(contents)
    fd.close()
예제 #2
0
def load(path):
    """Load a object from the binary representation of it in the
    file, path"""

    fd = LocalFile(path, 'r')
    contents = fd.read()
    fd.close()
    return loads(contents)
예제 #3
0
def load(path):
    """Load a object from the binary representation of it in the
    file, path"""

    fd = LocalFile(path, "r")
    contents = fd.read()
    fd.close()
    return loads(contents)
예제 #4
0
def dump(obj, path, protocol=0):
    """Dump a binary representation of obj to the file, path"""

    contents = dumps(obj)
    fd = LocalFile(path, 'w')
    fd.write(contents)
    fd.close()