#NEWLINE# def write_config( args ) : #NEWLINE# #INDENT# config_file = os . path . join ( os . path . expanduser ( '~' ) , '.bagcat' ) #NEWLINE# if os . path . isfile ( config_file ) : #NEWLINE# #INDENT# if ( input ( ( 'overwrite existing %s [Y/N] ' % config_file ) ) . upper ( ) != 'Y' ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# #UNINDENT# config = configparser . RawConfigParser ( ) #NEWLINE# for name in [ 'aws_access_key_id' , 'aws_secret_access_key' , 'bucket' ] : #NEWLINE# #INDENT# value = input ( ( '%s: ' % name ) ) #NEWLINE# config . set ( 'DEFAULT' , name , value ) #NEWLINE# #UNINDENT# config . write ( open ( args , 'w' ) )