'Instantiate ConfigParser and provide the file like object that we\'ll
use to read configuration data from.
:param cfg: Where we\'ll get configuration data. It can be either:
* A URL containing the file
* A valid file path inside the filesystem
* A string containing configuration data
:param tmpdir: Where we\'ll dump the temporary conf files.
:param raise_errors: Whether config value absences will raise
ValueError exceptions.'

def __init__(self, cfg, tmpdir='/tmp', raise_errors=False):

    self.parser = ConfigParser()
    self.raise_errors = raise_errors
    if hasattr(cfg, 'read'):
        self.cfg = cfg
        self.parser.readfp(self.cfg)
    elif isinstance(cfg, types.StringTypes):
        if (cfg.startswith('http') or cfg.startswith('ftp')):
            self.cfg = path.join(tmpdir, path.basename(cfg))
            utils.urlretrieve(cfg, self.cfg)
            self.parser.read(self.cfg)
        elif path.exists(path.abspath(cfg)):
            if path.isfile(cfg):
                self.cfg = path.abspath(cfg)
                self.parser.read(self.cfg)
            else:
                e_msg = ('Invalid    config    file    path:    %s' % cfg)
                raise IOError(e_msg)
        else:
            self.cfg = StringIO(cfg)
            self.parser.readfp(self.cfg)
