old_contents: from __future__ import with_statement
  import json
  
  
  def get_settings():
      """Parses the settings from redis-live.conf.
      """
      # TODO: Consider YAML. Human writable, machine readable.
      with open("redis-live.conf") as config:
          return json.load(config)
  
  
  def get_redis_servers():
      config = get_settings()
      return config["RedisServers"]
  
  
  def get_redis_stats_server():
      config = get_settings()
      return config["RedisStatsServer"]
  
  
  def get_data_store_type():
      config = get_settings()
      return config["DataStoreType"]
  
  
  def get_sqlite_stats_store():
      config = get_settings()
      return config["SqliteStatsStore"]
  
new_contents: #!/usr/bin/evn python
  #-*-coding:utf8-*-
  
  
  import json
  
  class settings(object):
  	def __init__(self, filename):
  		self.file = filename
  		self.get_settings()
  		
  	def get_settings(self):
  	    """Parses the settings from redis-live.conf.
  	    """
  	    # TODO: Consider YAML. Human writable, machine readable.
  	    with open(self.filename) as config:
  	        self.config = json.load(config)
  	
  
  	def get_redis_servers(self):
  	    return self.config["RedisServers"]
  	
  	
  	def get_redis_stats_server(self):
  	    return self.config["RedisStatsServer"]
  	
  	
  	def get_data_store_type(self):
  	    return self.config["DataStoreType"]
  	
  	
  	def get_sqlite_stats_store(self):
  	    return self.config["SqliteStatsStore"]
  
subject: optimize config read role