Ejemplo n.º 1
0
    def processIdentifiers(self, identifiers):
        plugin = None
        for identifier in identifiers:
            stamp, hostName, pluginName, identifier = self.parseIdentifier(identifier)

            if isinstance(plugin,Plugin):
                if pluginName != plugin.name:
                    print "[POLLER] QED %s@%s" % (plugin.name, plugin.host)
                    self.q.put(plugin)
                    plugin = None

            if self.evicted.__contains__(pluginName):
                continue

            try:
                if not isinstance(plugin,Plugin):
                    plugin = PluginFactory.get(pluginName, hostName)
                plugin.identifiers[identifier] = 0
            except Exception, e:
                self.evicted.append(pluginName)
                plugin = None
                print "[POLLER] ERROR evicting %s with exeception %s" % (pluginName, str(e))
Ejemplo n.º 2
0
main = GUIFactory.getClass("Main")(cfg.gui_cfg_item(cfg_item_name),cfg.gui_user_cfg_item(cfg_item_name))
#set callbacks
main.set_on_start(on_start)
main.set_on_pause(on_pause)
main.set_on_restart(on_restart)
main.set_on_stop(on_stop)
main.set_get_filter_fn(get_filter)

#load plugin
__enable_plugins=[]
for name in cfg.get("plugins"):
    program_cfg={}
    user_cfg={}
    program_cfg=cfg.plugin_cfg_item(name)
    user_cfg=cfg.plugin_user_cfg_item(name)
    __enable_plugins.append(PluginFactory.get_plugin_instance(name,program_cfg,user_cfg))


main.run()



#save config
cfg.set(cfg_item_name,main.get_cfg())
cfg.set(cfg_item_name,main.get_user_cfg(),True)

for p in __enable_plugins:
    cfg.set(p.name,p.get_cfg())
    cfg.set(p.name,p.get_user_cfg(),True)
cfg.save()