#NEWLINE# def set( self , key , val , env = None ) : #NEWLINE# #INDENT# "\n        Changes the value for the setting specified by 'key' to the new value.\n        By default this will change the current environment, but you can change\n        values in other environments by passing the name of that environment as\n        the 'env' parameter.\n        " #NEWLINE# if ( env is None ) : #NEWLINE# #INDENT# env = self . environment #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( env not in self . _settings ) : #NEWLINE# #INDENT# raise exc . EnvironmentNotFound ( ( "There is no environment named '%s'." % env ) ) #NEWLINE# #UNINDENT# #UNINDENT# dct = self . _settings [ env ] #NEWLINE# if ( key not in dct ) : #NEWLINE# #INDENT# raise exc . InvalidSetting ( ( "The setting '%s' is not defined." % key ) ) #NEWLINE# #UNINDENT# dct [ key ] = val #NEWLINE# if ( key == 'identity_type' ) : #NEWLINE# #INDENT# dct [ 'identity_class' ] = _import_identity ( val ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'region' ) : #NEWLINE# #INDENT# if ( not identity ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# current = identity . region #NEWLINE# if ( current == val ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( 'LON' in ( current , val ) ) : #NEWLINE# #INDENT# identity . region = val #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'verify_ssl' ) : #NEWLINE# #INDENT# if ( not identity ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# identity . verify_ssl = val