<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> import json <EOL> import os <EOL> import tempfile <EOL> import util <EOL> GCONF_FILE = os . path . join ( util . ROOT , '<STR_LIT>' , '<STR_LIT>' ) <EOL> DB_FILE = os . path . join ( util . ROOT , '<STR_LIT>' , '<STR_LIT>' ) <EOL> DB_CONF = """<STR_LIT>""" . lstrip ( ) <EOL> def update_env ( env ) : <EOL> """<STR_LIT>""" <EOL> conf = gconf_generate ( env ) <EOL> with open ( GCONF_FILE , '<STR_LIT:w>' ) as fout : <EOL> json . dump ( conf , fout , indent = <NUM_LIT:2> , sort_keys = True ) <EOL> with open ( DB_FILE , '<STR_LIT:w>' ) as fout : <EOL> fout . write ( DB_CONF . format ( ** conf ) ) <EOL> def gconf_generate ( env ) : <EOL> """<STR_LIT>""" <EOL> gconf = { <EOL> '<STR_LIT>' : os . path . join ( util . ROOT , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : env , <EOL> } <EOL> if env == '<STR_LIT:test>' : <EOL> gconf [ '<STR_LIT>' ] = tempfile . mkdtemp ( ) <EOL> gconf [ '<STR_LIT>' ] = os . path . join ( gconf [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> gconf [ '<STR_LIT>' ] = os . path . join ( gconf [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> return gconf <EOL> def get ( key ) : <EOL> """<STR_LIT>""" <EOL> with open ( GCONF_FILE ) as fin : <EOL> return json . load ( fin ) [ key ] </s>
