Esempio n. 1
0
def _local_recv(ssh, paths, dir_path, rec, preserve, check_hash):
    try:
        stdin, stdout, stderr = _open_channels(ssh, ' '.join(paths),
                                               True, rec, preserve, check_hash)
    except Exception as ex:
        sys.stderr.write(str(ex) + '\n')
        return 1

    ret = tfr.recv(stdin, stdout, sys.stderr, sys.stdout, dir_path, preserve, check_hash)
    if ret == error.E_OK or ret == error.E_END:
        return 0
    else:
        sys.stderr.write(stderr.readline())
        return 1
Esempio n. 2
0
def _remote_recv(dir_path, rec, preserve, check_hash):
    ret = tfr.recv(sys.stdout, sys.stdin, sys.stderr, None, dir_path, preserve, check_hash)
    if ret == error.E_OK or ret == error.E_END:
        return 0
    else:
        return 1