def __init__(self):
self._cache = {}<EOL>defaults = {}<EOL>for key in CONFIG_OPTIONS:<EOL><INDENT>defaults[key] = '<STR_LIT>'<EOL><DEDENT>defaults.update({<EOL>'<STR_LIT>': '<STR_LIT:true>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:host>': '<STR_LIT:127.0.0.1>',<EOL>'<STR_LIT>': '<STR_LIT:true>',<EOL>'<STR_LIT>': '<STR_LIT:false>',<EOL>'<STR_LIT>': '<STR_LIT:false>',<EOL>'<STR_LIT>': '<STR_LIT:false>',<EOL>})<EOL>self._defaults = self._new_parser(defaults=defaults)<EOL>self._environment = self._new_parser(defaults=config_from_environment())<EOL>self._global = self._new_parser()<EOL>if os.path.isdir(tower_dir):<EOL><INDENT>try:<EOL><INDENT>os.listdir(tower_dir)<EOL><DEDENT>except OSError:<EOL><INDENT>warnings.warn('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>RuntimeWarning)<EOL><DEDENT>self._global.read(os.path.join(tower_dir, '<STR_LIT>'))<EOL><DEDENT>self._user = self._new_parser()<EOL>user_filename = os.path.join(user_dir, CONFIG_FILENAME)<EOL>self._user.read(user_filename)<EOL>self._local = self._new_parser()<EOL>local_dir = os.getcwd()<EOL>local_dirs = [local_dir] if local_dir not in (user_dir, tower_dir) else []<EOL>while os.path.split(local_dir)[<NUM_LIT:1>]:<EOL><INDENT>local_dir, _ = os.path.split(local_dir)<EOL>if local_dir not in (user_dir, tower_dir):<EOL><INDENT>local_dirs = [local_dir] + local_dirs<EOL><DEDENT><DEDENT>for local_dir in local_dirs:<EOL><INDENT>local_filename = os.path.join(local_dir, CONFIG_FILENAME)<EOL>self._local.read(local_filename)<EOL><DEDENT>self._runtime = self._new_parser()<EOL>
Create the settings object, and read from appropriate files as
        well as from `sys.argv`.