def enable_plugin(self, pname):
        try:
            self.logger.debug("enabling plugin '%s'" % (pname))
            try:
                self.pluginmods[pname] = __import__(pname)
            except Exception, e:
                self.logger.error("exception importing '%s' plugin:\n%s" % (pname, shared.indent(traceback.format_exc().strip(), 1)))
            else:
                try:
                    self.pluginobjs[pname] = getattr(self.pluginmods[pname], pname)(self.global_config)
                except __HOLE__, e:
                    self.logger.error("plugin '%s' could not be loaded (%s)" % (pname, e))
                    self.disable_plugin(pname)
                else:
                    if not self.pluginobjs[pname].required_config_loaded():
                        self.logger.error("plugin '%s' requires config section '%s' with parameters %s" % (pname, pname, self.pluginobjs[pname].required_config))
                        self.disable_plugin(pname)
                    else:
                        self.logger.info("enabled plugin '%s'" % (pname))
        except Exception, e:
            self.logger.error("exception when initializing plugin '%s':\n%s" % (pname, shared.indent(traceback.format_exc().strip(), 1)))
            self.disable_plugin(pname)
dataset/ETHPy150Open zynga/hiccup/hiccup/PluginManager.py/PluginManager.enable_plugin