Example #1
0
    # Create the remote
    remote = Remote()

    # Setup the remote
    remote.setup(config.remote)

    # Remove specification of the remote
    arguments_no_remote = arguments[:-2]

    # Make a new temporary directory remotely
    remote_path = fs.join(remote.home_directory, temp_name)
    remote.create_directory(remote_path)
    remote.change_cwd(remote_path)

    # Send the appropriate command
    remote.launch_pts_command("get_poisson_errors", arguments_no_remote)

    # Retrieve the remote directory
    remote.download(remote_path, fs.cwd(), show_output=True)
    local_path = fs.join(fs.cwd(), fs.name(remote_path))

    # Remove the temporary remote directory
    remote.remove_directory(remote_path)

# Locally
else:

    # Make a local directory
    local_path = fs.join(fs.cwd(), temp_name)
    fs.create_directory(local_path)
    # Create the remote
    remote = Remote()

    # Setup the remote
    remote.setup(config.remote)

    # Remove specification of the remote
    arguments_no_remote = arguments[:-2]

    # Make a new temporary directory remotely
    remote_path = fs.join(remote.home_directory, temp_name)
    remote.create_directory(remote_path)
    remote.change_cwd(remote_path)

    # Send the appropriate command
    remote.launch_pts_command("get_poisson_errors", arguments_no_remote)

    # Retrieve the remote directory
    remote.download(remote_path, fs.cwd(), show_output=True)
    local_path = fs.join(fs.cwd(), fs.name(remote_path))

    # Remove the temporary remote directory
    remote.remove_directory(remote_path)

# Locally
else:

    # Make a local directory
    local_path = fs.join(fs.cwd(), temp_name)
    fs.create_directory(local_path)