s4cmd.py
def put_files(self, source, target):
    '''Upload files to S3.
       This function can handle multiple file upload if source is a list.
       Also, it works for recursive mode which copy all files and keep the
       directory structure under the given source directory.
    '''
    pool = ThreadPool(ThreadUtil, self.opt)
    if not isinstance(source, list):
      source = [source]

    if target[-1] == PATH_SEP:
      for src in source:
        self.put_single_file(pool, src, os.path.join(target, self.get_basename(src)))
    else:
      if len(source) == 1:
        self.put_single_file(pool, source[0], target)
      else:
        raise Failure('Target "%s" is not a directory (with a trailing slash).' % target)

    pool.join()
def put_files(self, source, target):
    '''Upload files to S3.
       This function can handle multiple file upload if source is a list.
       Also, it works for recursive mode which copy all files and keep the
       directory structure under the given source directory.
    '''
    pool = ThreadPool(ThreadUtil, self.opt)
    if not isinstance(source, list):
      source = [source]

    if target[-1] == PATH_SEP:
      for src in source:
        self.put_single_file(pool, src, os.path.join(target, self.get_basename(src)))
    else:
      if len(source) == 1:
        self.put_single_file(pool, source[0], target)
      else:
        raise Failure('Target "%s" is not a directory (with a trailing slash).' % target)

    pool.join()
def put_files ( self , source , target ) : pool = ThreadPool ( ThreadUtil , self . opt ) if not isinstance ( source , list ) : source = [ source ] if target [ - 1 ] == PATH_SEP : for src in source : self . put_single_file ( pool , src , os . path . join ( target , self . get_basename ( src ) ) ) else : if len ( source ) == 1 : self . put_single_file ( pool , source [ 0 ] , target ) else : raise Failure ( 'Target "%s" is not a directory (with a trailing slash).' % target ) pool . join ( )
Upload files to S3.
       This function can handle multiple file upload if source is a list.
       Also, it works for recursive mode which copy all files and keep the
       directory structure under the given source directory.
Upload files to S3 . This function can handle multiple file upload if source is a list . Also it works for recursive mode which copy all files and keep the directory structure under the given source directory .