@sync_performer
@do
def perform_download_s3_key_recursively(dispatcher, intent):
 keys = (yield Effect(ListS3Keys(prefix=(intent.source_prefix + '/'), bucket=intent.source_bucket)))
 for key in keys:
  if (not key.endswith(intent.filter_extensions)):
   continue
  path = intent.target_path.preauthChild(key)
  if (not path.parent().exists()):
   path.parent().makedirs()
  source_key = os.path.join(intent.source_prefix, key)
  (yield Effect(DownloadS3Key(source_bucket=intent.source_bucket, source_key=source_key, target_path=path)))

@ sync_performer @ do def perform_download_s3_key_recursively ( dispatcher , intent ) : keys = ( yield Effect ( ListS3Keys ( prefix = ( intent . source_prefix + '/' ) , bucket = intent . source_bucket ) ) ) for key in keys : if ( not key . endswith ( intent . filter_extensions ) ) : continue path = intent . target_path . preauthChild ( key ) if ( not path . parent ( ) . exists ( ) ) : path . parent ( ) . makedirs ( ) source_key = os . path . join ( intent . source_prefix , key ) ( yield Effect ( DownloadS3Key ( source_bucket = intent . source_bucket , source_key = source_key , target_path = path ) ) )
see :class:downloads3keyrecursively .