def discover_configs():
 try:
  config = os.environ['SENTRY_CONF']
 except KeyError:
  config = '~/.sentry'
 config = os.path.expanduser(config)
 if (config.endswith(('.py', '.conf')) or os.path.isfile(config)):
  return (os.path.dirname(config), config, None)
 return (config, os.path.join(config, DEFAULT_SETTINGS_OVERRIDE), os.path.join(config, DEFAULT_SETTINGS_CONF))

def discover_configs ( ) : try : config = os . environ [ 'SENTRY_CONF' ] except KeyError : config = '~/.sentry' config = os . path . expanduser ( config ) if ( config . endswith ( ( '.py' , '.conf' ) ) or os . path . isfile ( config ) ) : return ( os . path . dirname ( config ) , config , None ) return ( config , os . path . join ( config , DEFAULT_SETTINGS_OVERRIDE ) , os . path . join ( config , DEFAULT_SETTINGS_CONF ) )
discover the locations of three configuration components: * config directory * optional python config file * optional yaml config .