File manager - Edit - /home/u478019808/domains/bestandroidphones.store/public_html/static/img/logo/cloud_api_delegator.cpython-39.pyc.tar
Back
opt/gsutil/gslib/__pycache__/cloud_api_delegator.cpython-39.pyc 0000644 00000053303 15025233507 0020611 0 ustar 00 a +(Wg}w � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm Z dd l mZ dd l mZ ddl mZ ddl mZ dd lmZ ddlmZ G dd� de�ZdS )zBGsutil API delegator for interacting with cloud storage providers.� )�absolute_import)�print_function)�division)�unicode_literalsN)�config)�context_config)�ArgumentException)�CloudApi)�ApiMapConstants)�ApiSelector)�CommandException)� boto_utilc s e Zd ZdZdj� fdd� Zdd� Zdd � Zdkd d�Zdldd �Zdmdd�Z dndd�Z dodd�Zdpdd�Zdqdd�Z drdd�Zdsdd�Zdtdd�Zdudd�Zdvd d!�Zdwd"d#�Zdxd$d%�Zdyd&d'�Zdddd(ejjddddddfd)d*�Zdzd+d,�Zd{d-d.�Zd|d/d0�Zd}d1d2�Zd~d3d4�Zdd5d6�Zd�d7d8�Z d�d9d:�Z!d�d;d<�Z"d�d=d>�Z#d�d?d@�Z$d�dAdB�Z%d�dCdD�Z&d�dEdF�Z'd�dGdH�Z(d�dIdJ�Z)d�dKdL�Z*d�dMdN�Z+d�dOdP�Z,dQdR� Z-d�dSdT�Z.d�dUdV�Z/d�dXdY�Z0d�dZd[�Z1d�d\d]�Z2d�d^d_�Z3d�d`da�Z4d�dbdc�Z5d�ddde�Z6d�dfdg�Z7d�dhdi�Z8� Z9S )��CloudApiDelegatora� Class that handles delegating requests to gsutil Cloud API implementations. This class is responsible for determining at runtime which gsutil Cloud API implementation should service the request based on the Cloud storage provider, command-level API support, and configuration file override. During initialization it takes as an argument a gsutil_api_map which maps providers to their default and supported gsutil Cloud API implementations (see comments in cs_api_map for details). Instantiation of multiple delegators per-thread is required for multiprocess and/or multithreaded operations. Calling methods on the same delegator in multiple threads is unsafe. Nr c s\ t t| �j|||||||| | d� || _tj�ddd��� | _i | _ | jt j sXtd��dS )a3 Performs necessary setup for delegating cloud storage requests. This function has different arguments than the gsutil Cloud API __init__ function because of the delegation responsibilties of this class. Args: bucket_storage_uri_class: boto storage_uri class, used by APIs that provide boto translation or mocking. gsutil_api_map: Map of providers and API selector tuples to api classes which can be used to communicate with those providers. logger: logging.logger for outputting log messages. status_queue: Queue for relaying status to UI. provider: Default provider prefix describing cloud storage provider to connect to. debug: Debug level for the API implementation (0..3). http_headers (dict|None): Arbitrary headers to be included in every request. trace_token: Apiary trace token to pass to API. perf_trace_token: Performance trace token to use when making API calls. user_project: Project to be billed for this project. ��provider�debug�http_headers�trace_token�perf_trace_token�user_project�GSUtil� prefer_api� z.No apiclass supplied for gsutil Cloud API map.N) �superr �__init__�api_map�botor �get�upperr �loaded_apisr �API_MAPr )�self�bucket_storage_uri_class�gsutil_api_map�logger�status_queuer r r r r r �� __class__� �(/opt/gsutil/gslib/cloud_api_delegator.pyr 1 s � zCloudApiDelegator.__init__c C sd |p| j }|std��t|�}|| jvr2i | j|<