diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-08-11 15:36:23 +0200 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-08-11 15:36:23 +0200 |
commit | de7ae6b763e48607f7d1da8f4f98bd7386cccba8 (patch) | |
tree | 60b61555cba7712e850fbecb7a37a1dca26b7a23 /src/Gui/PluginList.py | |
parent | 13329d88e147fac7cafcdebcafd1859a74a27aa9 (diff) | |
download | abrt-de7ae6b763e48607f7d1da8f4f98bd7386cccba8.tar.gz abrt-de7ae6b763e48607f7d1da8f4f98bd7386cccba8.tar.xz abrt-de7ae6b763e48607f7d1da8f4f98bd7386cccba8.zip |
GUI: Added option to disable/enable plugins (config preview)
Diffstat (limited to 'src/Gui/PluginList.py')
-rw-r--r-- | src/Gui/PluginList.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/Gui/PluginList.py b/src/Gui/PluginList.py new file mode 100644 index 00000000..b315eb95 --- /dev/null +++ b/src/Gui/PluginList.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +import CCDBusBackend +from ABRTPlugin import PluginInfo, PluginSettings + +class PluginInfoList(list): + """Class to store list of PluginInfos""" + def __init__(self,dbus_manager=None): + self.dm = dbus_manager + self.ddict = {} + + def load(self): + if self.dm: + #print "loading PluginList" + try: + rows = self.dm.getPluginsInfo() + #print rows + for row in rows: + entry = PluginInfo() + for column in row: + #print "PluginInfoList adding %s:%s" % (column,row[column]) + entry.__dict__[column] = row[column] + if entry.Enabled == "yes": + #print ">>%s<<" % entry + entry.Settings = PluginSettings(self.dm.getPluginSettings(str(entry))) + #for i in entry.Settings.keys(): + # print "%s: %s" % (i, entry.Settings[i]) + #else: + # print "%s is disabled" % entry + self.append(entry) + self.ddict[entry.getName()] = entry + except Exception, e: + print e + return + else: + print "db == None!" + + +__PFList = None +__PFList_dbmanager = None + +def getPluginInfoList(dbmanager,refresh=None): + global __PFList + global __PFList_dbmanager + + if __PFList == None or refresh or __PFList_dbmanager != dbmanager: + __PFList = PluginInfoList(dbus_manager=dbmanager) + __PFList.load() + __PFList_dbmanager = dbmanager + return __PFList + +__PFList = None |