scripts/upload_services/transferwee.py
def upload(files: List[str], message: str = '', sender: str = None,
           recipients: List[str] = []) -> str:
    """Given a list of files upload them and return the corresponding URL.

    Also accepts optional parameters:
     - `message': message used as a description of the transfer
     - `sender': email address used to receive an ACK if the upload is
                 successful. For every download by the recipients an email
                 will be also sent
     - `recipients': list of email addresses of recipients. When the upload
                     succeed every recipients will receive an email with a link

    If both sender and recipient parameters are passed the email upload will be
    used. Otherwise, the link upload will be used.

    Return the short URL of the transfer on success.
    """

    # Check that all files exists
    for f in files:
        if not os.path.exists(f):
            raise FileNotFoundError(f)

    # Check that there are no duplicates filenames
    # (despite possible different dirname())
    filenames = [os.path.basename(f) for f in files]
    if len(files) != len(set(filenames)):
        raise FileExistsError('Duplicate filenames')

    transfer_id = None
    s = _prepare_session()
    if sender and recipients:
        # email upload
        transfer_id = \
            _prepare_email_upload(files, message, sender, recipients, s)['id']
        _verify_email_upload(transfer_id, s)
    else:
        # link upload
        transfer_id = _prepare_link_upload(files, message, s)['id']

    for f in files:
        file_id = _prepare_file_upload(transfer_id, f, s)['id']
        _upload_chunks(transfer_id, file_id, f, s)

    return _finalize_upload(transfer_id, s)['shortened_url']
Given a list of files upload them and return the corresponding URL.

    Also accepts optional parameters:
     - `message': message used as a description of the transfer
     - `sender': email address used to receive an ACK if the upload is
                 successful. For every download by the recipients an email
                 will be also sent
     - `recipients': list of email addresses of recipients. When the upload
                     succeed every recipients will receive an email with a link

    If both sender and recipient parameters are passed the email upload will be
    used. Otherwise, the link upload will be used.

    Return the short URL of the transfer on success.
    
Given a list of files upload them and return the corresponding URL.
Also accepts optional parameters:
`message': message used as a description of the transfer
`sender': email address used to receive an ACK if the upload is
successful. For every download by the recipients an email
will be also sent
`recipients': list of email addresses of recipients. When the upload
succeed every recipients will receive an email with a link

If both sender and recipient parameters are passed the email upload will be
used. Otherwise, the link upload will be used.

Return the short URL of the transfer on success.
Given a list of files upload them and return the corresponding URL . Also accepts optional parameters : ` message ' : message used as a description of the transfer ` sender ' : email address used to receive an ACK if the upload is successful . For every download by the recipients an email will be also sent ` recipients ' : list of email addresses of recipients . When the upload succeed every recipients will receive an email with a link If both sender and recipient parameters are passed the email upload will be used . Otherwise the link upload will be used . Return the short URL of the transfer on success .
def upload(files: List[str], message: str = '', sender: str = None,
           recipients: List[str] = []) -> str:
    for f in files:
        if not os.path.exists(f):
            raise FileNotFoundError(f)
    filenames = [os.path.basename(f) for f in files]
    if len(files) != len(set(filenames)):
        raise FileExistsError('Duplicate filenames')
    transfer_id = None
    s = _prepare_session()
    if sender and recipients:
        transfer_id = \
            _prepare_email_upload(files, message, sender, recipients, s)['id']
        _verify_email_upload(transfer_id, s)
    else:
        transfer_id = _prepare_link_upload(files, message, s)['id']
    for f in files:
        file_id = _prepare_file_upload(transfer_id, f, s)['id']
        _upload_chunks(transfer_id, file_id, f, s)
    return _finalize_upload(transfer_id, s)['shortened_url']
def upload ( files : List [ str ] , message : str = '' , sender : str = None , recipients : List [ str ] = [ ] ) -> str : for f in files : if not os . path . exists ( f ) : raise FileNotFoundError ( f ) filenames = [ os . path . basename ( f ) for f in files ] if len ( files ) != len ( set ( filenames ) ) : raise FileExistsError ( 'Duplicate filenames' ) transfer_id = None s = _prepare_session ( ) if sender and recipients : transfer_id = _prepare_email_upload ( files , message , sender , recipients , s ) [ 'id' ] _verify_email_upload ( transfer_id , s ) else : transfer_id = _prepare_link_upload ( files , message , s ) [ 'id' ] for f in files : file_id = _prepare_file_upload ( transfer_id , f , s ) [ 'id' ] _upload_chunks ( transfer_id , file_id , f , s ) return _finalize_upload ( transfer_id , s ) [ 'shortened_url' ]
Given a list of files upload them and return the corresponding URL.
Given a list of files upload them and return the corresponding URL .
"""Given a list of files upload them and return the corresponding URL.

    Also accepts optional parameters:
     - `message': message used as a description of the transfer
     - `sender': email address used to receive an ACK if the upload is
                 successful. For every download by the recipients an email
                 will be also sent
     - `recipients': list of email addresses of recipients. When the upload
                     succeed every recipients will receive an email with a link

    If both sender and recipient parameters are passed the email upload will be
    used. Otherwise, the link upload will be used.

    Return the short URL of the transfer on success.
    """ # Check that all files exists # Check that there are no duplicates filenames # (despite possible different dirname()) # email upload # link upload
files
List[str]
message
str
sender
str
recipients
List[str]