solvebio/cli/data.py
def upload(args):
    """
    Given a folder or file, upload all the folders and files contained
    within it, skipping ones that already exist on the remote.
    """
    base_remote_path, path_dict = Object.validate_full_path(
        args.full_path, vault=args.vault, path=args.path)

    # Assert the vault exists and is accessible
    vault = Vault.get_by_full_path(path_dict['vault_full_path'])

    # If not the vault root, validate remote path exists and is a folder
    if path_dict['path'] != '/':
        Object.get_by_full_path(base_remote_path, assert_type='folder')

    for local_path in args.local_path:
        local_path = local_path.rstrip('/')
        local_start = os.path.basename(local_path)

        if os.path.isdir(local_path):
            _upload_folder(path_dict['domain'], vault,
                           base_remote_path, local_path, local_start)
        else:
            Object.upload_file(local_path, path_dict['path'],
                               vault.full_path)
def upload(args):
    base_remote_path, path_dict = Object.validate_full_path(
        args.full_path, vault=args.vault, path=args.path)

    # Assert the vault exists and is accessible
    vault = Vault.get_by_full_path(path_dict['vault_full_path'])

    # If not the vault root, validate remote path exists and is a folder
    if path_dict['path'] != '/':
        Object.get_by_full_path(base_remote_path, assert_type='folder')

    for local_path in args.local_path:
        local_path = local_path.rstrip('/')
        local_start = os.path.basename(local_path)

        if os.path.isdir(local_path):
            _upload_folder(path_dict['domain'], vault,
                           base_remote_path, local_path, local_start)
        else:
            Object.upload_file(local_path, path_dict['path'],
                               vault.full_path)
def upload ( args ) : base_remote_path , path_dict = Object . validate_full_path ( args . full_path , vault = args . vault , path = args . path ) # Assert the vault exists and is accessible vault = Vault . get_by_full_path ( path_dict [ 'vault_full_path' ] ) # If not the vault root, validate remote path exists and is a folder if path_dict [ 'path' ] != '/' : Object . get_by_full_path ( base_remote_path , assert_type = 'folder' ) for local_path in args . local_path : local_path = local_path . rstrip ( '/' ) local_start = os . path . basename ( local_path ) if os . path . isdir ( local_path ) : _upload_folder ( path_dict [ 'domain' ] , vault , base_remote_path , local_path , local_start ) else : Object . upload_file ( local_path , path_dict [ 'path' ] , vault . full_path )
Given a folder or file, upload all the folders and files contained
    within it, skipping ones that already exist on the remote.
Given a folder or file upload all the folders and files contained within it skipping ones that already exist on the remote .