from ConfigParser import ConfigParser

# ConfigParser is an old style class. Thus, multiple inheritance is used
# in order to call super later.
class ConfigLoader(ConfigParser, object):
  """
  The class inherits from ConfigParser. However, it keeps the original
  configuration file's path
  """
  def __init__(self, config_path):
    """
    Load the configuration file and remember its path.

    @param config_path the path of a configuration file.
    @type config_path: str
    """
    try:
      super(ConfigLoader, self).__init__(allow_no_value=True)
    except Exception:
      super(ConfigLoader, self).__init__()
    self.readfp(open(config_path))
    self.path = config_path