def read_config(self, fp):
        section = self.configroot.supervisorctl
        if not hasattr(fp, 'read'):
            self.here = os.path.dirname(normalize_path(fp))
            try:
                fp = open(fp, 'r')
            except (IOError, __HOLE__):
                raise ValueError("could not find config file %s" % fp)
        config = UnhosedConfigParser()
        config.mysection = 'supervisorctl'
        config.readfp(fp)
        sections = config.sections()
        if not 'supervisorctl' in sections:
            raise ValueError,'.ini file does not include supervisorctl section'
        serverurl = config.getdefault('serverurl', 'http://localhost:9001')
        if serverurl.startswith('unix://'):
            sf = serverurl[7:]
            path = expand(sf, {'here':self.here}, 'serverurl')
            path = normalize_path(path)
            serverurl = 'unix://%s' % path
        section.serverurl = serverurl

        # The defaults used below are really set in __init__ (since
        # section==self.configroot.supervisorctl)
        section.prompt = config.getdefault('prompt', section.prompt)
        section.username = config.getdefault('username', section.username)
        section.password = config.getdefault('password', section.password)
        history_file = config.getdefault('history_file', section.history_file)

        if history_file:
            history_file = normalize_path(history_file)
            section.history_file = history_file
            self.history_file = history_file
        else:
            section.history_file = None
            self.history_file = None

        from supervisor.supervisorctl import DefaultControllerPlugin
        self.plugin_factories = self.get_plugins(
            config,
            'supervisor.ctl_factory',
            'ctlplugin:'
            )
        default_factory = ('default', DefaultControllerPlugin, {})
        # if you want to a supervisorctl without the default plugin,
        # please write your own supervisorctl.
        self.plugin_factories.insert(0, default_factory)

        return section
dataset/ETHPy150Open XiaoMi/minos/supervisor/supervisor/options.py/ClientOptions.read_config