ó U!¶\c@s³dZddlZddlmZidddgddfd6d5d6d6d 6d7d 6d8d6ddidfd6d9d6dddefd6dddefd6ddedfd6ddeejfd6dddefd6d:d6d"d#eejfd"6Z d$„Z d%e fd&„ƒYZ d'e fd(„ƒYZ d)e fd*„ƒYZd+efd,„ƒYZd-efd.„ƒYZd/efd0„ƒYZd1efd2„ƒYZd3efd4„ƒYZdS(;sOThis module contains the inteface for controlling how configuration is loaded. iÿÿÿÿN(tutilstAWS_DEFAULT_PROFILEt AWS_PROFILEtprofiletregiontAWS_DEFAULT_REGIONt data_patht AWS_DATA_PATHtAWS_CONFIG_FILEs ~/.aws/configt config_filet ca_bundlet AWS_CA_BUNDLEt api_versionstAWS_SHARED_CREDENTIALS_FILEs~/.aws/credentialstcredentials_filetmetadata_service_timeouttAWS_METADATA_SERVICE_TIMEOUTitmetadata_service_num_attemptst!AWS_METADATA_SERVICE_NUM_ATTEMPTStparameter_validationt csm_enabledtAWS_CSM_ENABLEDtcsm_portt AWS_CSM_PORTiyt csm_client_idtAWS_CSM_CLIENT_IDttendpoint_discovery_enabledtAWS_ENDPOINT_DISCOVERY_ENABLEDc Csei}xXtjƒD]J\}}|jd|d|dd|dd|dd|d ƒ|| config_property_name -> default. Any values that were none are omitted form the chain. t instance_varR1tnamestenvtconfig_var_nametvaluet providersR!N( R,tappendtInstanceVarProviderR+tEnvironmentProviderR/tScopedConfigProvidertConstantProvidert ChainProvider(R0RRRR R!R8((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyR$xs*'    N(t__name__t __module__t__doc__R,R2R$(((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyR*as  tConfigValueStorecBs>eZdZdd„Zd„Zd„Zd„Zd„ZRS(s8The ConfigValueStore object stores configuration values.cCsRi|_i|_|dk rNx-|jƒD]\}}|j||ƒq+WndS(sNInitialize a ConfigValueStore. :type mapping: dict :param mapping: The mapping parameter is a map of string to a subclass of BaseProvider. When a config variable is asked for via the get_config_variable method, the corresponding provider will be invoked to load the value. N(t _overridest_mappingR,R#tset_config_provider(R0R&R'tprovider((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyR2Às   cCsD||jkr|j|S||jkr-dS|j|}|jƒS(s Retrieve the value associeated with the specified logical_name from the corresponding provider. If no value is found None will be returned. :type logical_name: str :param logical_name: The logical name of the session variable you want to retrieve. This name will be mapped to the appropriate environment variable name for this session as well as the appropriate config file entry. :returns: value of variable or None if not defined. N(RCRDR,tprovide(R0R'RF((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pytget_config_variableÏs   cCs||j|>> # Assume logical name 'foo' maps to env var 'FOO' >>> os.environ['FOO'] = 'myvalue' >>> s.get_config_variable('foo') 'myvalue' >>> s.set_config_variable('foo', 'othervalue') >>> s.get_config_variable('foo') 'othervalue' :type logical_name: str :param logical_name: The logical name of the session variable you want to set. These are the keys in ``SESSION_VARIABLES``. :param value: The value to associate with the config variable. N(RC(R0R'R7((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pytset_config_variableäscCs|jj|dƒdS(sÃRemove an override config variable from the session. :type logical_name: str :param logical_name: The name of the parameter to clear the override value from. N(RCtpopR,(R0R'((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pytclear_config_variableþscCs||j|cBs8eZdZddd„Zd„Zd„Zd„ZRS(sŸThis provider wraps one or more other providers. Each provider in the chain is called, the first one returning a non-None value is then returned. cCs+|dkrg}n||_||_dS(sœInitalize a ChainProvider. :type providers: list :param providers: The initial list of providers to check for values when invoked. :type conversion_func: None or callable :param conversion_func: If this value is None then it has no affect on the return type. Otherwise, it is treated as a function that will transform provided value. N(R,t _providerst_conversion_func(R0R8R!((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyR2*s   cCs=x6|jD]+}|jƒ}|dk r |j|ƒSq WdS(s*Provide the value from the first provider to return non-None. Each provider in the chain has its provide method called. The first one in the chain to return a non-None value is the returned from the ChainProvider. When no non-None value is found, None is returned. N(RNRGR,t _convert_type(R0RFR7((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyRG;s   cCs |jdk r|j|ƒS|S(N(ROR,(R0R7((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyRPHs cCs-ddjg|jD]}t|ƒ^qƒS(Ns[%s]s, (tjoinRNtstr(R0tp((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyt__repr__MsN(R?R@RAR,R2RGRPRT(((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyR>$s  R:cBs)eZdZd„Zd„Zd„ZRS(s>This class loads config values from the session instance vars.cCs||_||_dS(s>Initialize InstanceVarProvider. :type instance_var: str :param instance_var: The instance variable to load from the session. :type session: :class:`botocore.session.Session` :param session: The botocore session to get the loaded configuration file variables from. N(t _instance_varR+(R0R3R1((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyR2Ss cCs%|jjƒ}|j|jƒ}|S(s6Provide a config value from the session instance vars.(R+tinstance_variablestgetRU(R0t instance_varsR7((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyRG`scCsd|j|jfS(Ns0InstanceVarProvider(instance_var=%s, session=%s)(RUR+(R0((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyRTfs(R?R@RAR2RGRT(((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyR:Qs R<cBs#eZd„Zd„Zd„ZRS(cCs||_||_dS(sfInitialize ScopedConfigProvider. :type config_var_name: str :param config_var_name: The name of the config variable to load from the configuration file. :type session: :class:`botocore.session.Session` :param session: The botocore session to get the loaded configuration file variables from. N(t_config_var_nameR+(R0R6R1((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyR2ns cCs%|jjƒ}|j|jƒ}|S(s,Provide a value from a config file property.(R+tget_scoped_configRWRY(R0R(R7((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyRG|scCsd|j|jfS(Ns4ScopedConfigProvider(config_var_name=%s, session=%s)(RYR+(R0((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyRT‚s(R?R@R2RGRT(((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyR<ms  R;cBs)eZdZd„Zd„Zd„ZRS(s:This class loads config values from environment variables.cCs||_||_dS(süInitialize with the keys in the dictionary to check. :type names: str or list :param names: If this is a str, the key with that name will be loaded and returned. If this variable is a list, then it must be a list of str. The same process will be repeated for each string in the list, the first that returns non None will be returned. :type env: dict :param env: Environment variables dictionary to get variables from. N(t_namest_env(R0R4R5((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyR2‹s cCsS|j}t|tƒs$|g}nx(|D] }||jkr+|j|Sq+WdS(s0Provide a config value from a source dictionary.N(R[t isinstancetlistR\R,(R0R4tname((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyRG›s   cCsd|j|jfS(Ns%EnvironmentProvider(names=%s, env=%s)(R[R\(R0((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyRT¥s (R?R@RAR2RGRT(((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyR;‰s  R=cBs)eZdZd„Zd„Zd„ZRS(s(This provider provides a constant value.cCs ||_dS(N(t_value(R0R7((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyR2¬scCs|jS(s7Provide the constant value given during initialization.(R`(R0((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyRG¯scCs d|jS(NsConstantProvider(value=%s)(R`(R0((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyRT³s(R?R@RAR2RGRT(((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyR=ªs  (RRNN(RRNN(NRs ~/.aws/configN(R R NN(NR s~/.aws/credentialsN(RRRN(RAR-tbotocoreRR,tinttTruetFalsetensure_booleanR"R)tobjectR*RBRLR>R:R<R;R=(((s;/tmp/pip-install-usGedi/botocore/botocore/configprovider.pyts<  ][ -!