def set_connection(connection=defaults.sqlalchemy_connection_string_default):
cfp = defaults.config_file_path<EOL>config = RawConfigParser()<EOL>connection = connection.strip()<EOL>if not os.path.exists(cfp):<EOL><INDENT>with open(cfp, '<STR_LIT:w>') as config_file:<EOL><INDENT>config['<STR_LIT>'] = {'<STR_LIT>': connection}<EOL>config.write(config_file)<EOL>log.info('<STR_LIT>'.format(cfp))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>config.read(cfp)<EOL>config.set('<STR_LIT>', '<STR_LIT>', connection)<EOL>with open(cfp, '<STR_LIT:w>') as configfile:<EOL><INDENT>config.write(configfile)<EOL><DEDENT><DEDENT>
Set the connection string for sqlalchemy and writes to the configuration file
:param str connection: sqlalchemy connection string