File: //usr/lib/python3/dist-packages/duplicity/backends/__pycache__/_boto_single.cpython-310.pyc
o
�~�_�: � @ s� d dl mZ d dlmZ d dlmZ d dlZd dlZd dlZ d dl m
Z
d dl mZ d dlm
Z
mZ d dl mZ d d l mZ d
Zdd� ZG d
d� de jj�ZdS )� )�division)�str)�ThreadPoolExecutorN)�config)�log)�FatalBackendException�BackendException)�progress)�utilz2.1.1c C s0 zJddl m} t|d�sJ �zddl m} ddl m} d}|� }W n
ty. d}d }Y nw tjrA|r8|� }nt� dtj
j� n|rG|� }nd }W n ty] t� d t tj
j
� Y nw |jsj|jtj d
�}n| dkspJ �|j|j|jtj d�}t|d
�r�|d u r�t� dtj
j� |S ||_|S td��)Nr )�S3Connection�lookup)�OrdinaryCallingFormat)�SubdomainCallingFormatTFz�Use of new-style (subdomain) S3 bucket addressing wasrequested, but does not seem to be supported by the boto library. Either you need to upgrade your boto library or duplicity has failed to correctly detect the appropriate support.z_This backend (s3) requires boto library, version %s or later, (http://code.google.com/p/boto/).)� is_secure�s3)�host�portr �calling_formatz�It seems we previously failed to detect support for calling formats in the boto library, yet the support is there. This is almost certainly a duplicity bug.�Boto requires a bucket name.)�boto.s3.connectionr �hasattrr
r �ImportErrorr �s3_use_new_styler �
FatalError� ErrorCode�boto_old_style�BOTO_MIN_VERSION�boto_lib_too_old�hostname�connect�s3_unencrypted_connectionr �boto_calling_formatr r ) �scheme�
parsed_url�storage_urir r
r �
cfs_supportedr �conn� r'