diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-23 15:51:54 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-23 15:51:54 +0100 |
commit | 86fc61db75385d6fb452b4cf88aec1deffa3a5be (patch) | |
tree | 8b88bd46ef8fe05167f72b3d1f0bff034620b9a1 /src/gui | |
parent | d992b91c61b4da10e1f977038d85cd640f8d7ae5 (diff) | |
download | abrt-86fc61db75385d6fb452b4cf88aec1deffa3a5be.tar.gz abrt-86fc61db75385d6fb452b4cf88aec1deffa3a5be.tar.xz abrt-86fc61db75385d6fb452b4cf88aec1deffa3a5be.zip |
remove sqlite DB
This change removes sqlite database.
Database was used to find dump dirs by [UID:]UUID.
This patch uses more natural way: dump dirs are addressed by their
directory names.
DB was also used to produce a list of dump dirs.
Now it is done by iterating over the /var/spool/abrt directory.
And finally, DB was also used to find duplicate UUIDs.
Now it is done by iterating over the /var/spool/abrt directory.
Crash count, "inform all" and reporting result message are moved
from DB field to a file in dump dir.
"Reported" DB field is deleted -
if message != "", then this dump was reported.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/CCDump.py | 28 | ||||
-rw-r--r-- | src/gui/CCDumpList.py | 3 | ||||
-rw-r--r-- | src/gui/CCMainWindow.py | 15 | ||||
-rw-r--r-- | src/gui/CCReporterDialog.py | 4 | ||||
-rw-r--r-- | src/gui/CReporterAssistant.py | 2 |
5 files changed, 25 insertions, 27 deletions
diff --git a/src/gui/CCDump.py b/src/gui/CCDump.py index a2a69023..380cb996 100644 --- a/src/gui/CCDump.py +++ b/src/gui/CCDump.py @@ -35,13 +35,13 @@ FILENAME_RATING = "rating" FILENAME_HOSTNAME = "hostname" FILENAME_REMOTE = "remote" -CD_UID = "uid" -CD_UUID = "uuid" -CD_INFORMALL = "InformAll" +FILENAME_UID = "uid" +FILENAME_UUID = "uuid" +FILENAME_INFORMALL = "inform_all_users" +FILENAME_COUNT = "count" +FILENAME_MESSAGE = "message" + CD_DUMPDIR = "DumpDir" -CD_COUNT = "Count" -CD_REPORTED = "Reported" -CD_MESSAGE = "Message" CD_EVENTS = "Events" # FIXME - create method or smth that returns type|editable|content @@ -52,7 +52,7 @@ REPORT_EVENT_PREFIX = "report_" class Dump(): """Class for mapping the debug dump to python object""" - not_required_fields = ["comment", "Message"] + not_required_fields = [FILENAME_COMMENT, FILENAME_MESSAGE] def __init__(self): # we set all attrs dynamically, so no need to have it in init for field in self.not_required_fields: @@ -79,8 +79,11 @@ class Dump(): def getUID(self): return self.uid + def getDumpDir(self): + return self.DumpDir + def getCount(self): - return int(self.Count) + return int(self.count) def getExecutable(self): try: @@ -96,14 +99,11 @@ class Dump(): def getPackage(self): return self.package - def isReported(self): - return self.Reported == "1" - def getMessage(self): - if not self.Message: + if not self.message: return "" #[] - #return self.Message[CD_CONTENT].split('\n') - return self.Message + #return self.message[CD_CONTENT].split('\n') + return self.message def getTime(self, fmt=None): if self.time: diff --git a/src/gui/CCDumpList.py b/src/gui/CCDumpList.py index 3c555d84..ccc87560 100644 --- a/src/gui/CCDumpList.py +++ b/src/gui/CCDumpList.py @@ -30,8 +30,7 @@ class DumpList(list): def getDumpByCrashID(self, crashid): for dump in self: - # crashid can be either hash or uid:hash - if crashid in (dump.getUUID(),dump.getUID()+":"+dump.getUUID()): + if crashid == dump.getDumpDir(): return dump __PFList = None diff --git a/src/gui/CCMainWindow.py b/src/gui/CCMainWindow.py index 4ee14768..651c8e54 100644 --- a/src/gui/CCMainWindow.py +++ b/src/gui/CCMainWindow.py @@ -184,7 +184,7 @@ class MainWindow(): # so we shouldn't continue.. sys.exit() for entry in dumplist[::-1]: - n = self.dumpsListStore.append([["gtk-no","gtk-yes"][entry.isReported()], + n = self.dumpsListStore.append([["gtk-no","gtk-yes"][entry.getMessage() != ""], entry.getExecutable(), entry.get_hostname(), entry.getTime("%c"), @@ -276,7 +276,7 @@ class MainWindow(): #move this to Dump class hb_reports = self.wTree.get_widget("hb_reports") lReported = self.wTree.get_widget("l_message") - if dump.isReported(): + if dump.getMessage() != "": hb_reports.show() report_label_raw = "" report_label = "" @@ -296,10 +296,10 @@ class MainWindow(): else: hb_reports.hide() - def mark_last_selected_row(self, dump_list_store, path, iter, last_selected_uuid): + def mark_last_selected_row(self, dump_list_store, path, iter, last_selected_DumpDir): # Get dump object from list (in our list it's in last col) dump = dump_list_store.get_value(iter, dump_list_store.get_n_columns()-1) - if dump.getUUID() == last_selected_uuid: + if dump.getDumpDir() == last_selected_DumpDir: self.dlist.set_cursor(dump_list_store.get_path(iter)[0]) return True # done, stop iteration return False @@ -315,11 +315,11 @@ class MainWindow(): if next_iter: last_dump = dumpsListStore.get_value(next_iter, dumpsListStore.get_n_columns()-1) try: - self.ccdaemon.DeleteDebugDump("%s:%s" % (dump.getUID(), dump.getUUID())) + self.ccdaemon.DeleteDebugDump(dump.getDumpDir()) self.hydrate() if last_dump: # we deleted the selected line, so we want to select the next one - dumpsListStore.foreach(self.mark_last_selected_row, last_dump.getUUID()) + dumpsListStore.foreach(self.mark_last_selected_row, last_dump.getDumpDir()) treeview.emit("cursor-changed") except Exception, ex: print ex @@ -363,8 +363,7 @@ class MainWindow(): self.hydrate() if last_dump: # re-select the line that was selected before a new crash happened - dumpsListStore.foreach(self.mark_last_selected_row, last_dump.getUUID()) - + dumpsListStore.foreach(self.mark_last_selected_row, last_dump.getDumpDir()) def on_bReport_clicked(self, button): dumpsListStore, path = self.dumplist_get_selected() diff --git a/src/gui/CCReporterDialog.py b/src/gui/CCReporterDialog.py index 947a2582..b34baf87 100644 --- a/src/gui/CCReporterDialog.py +++ b/src/gui/CCReporterDialog.py @@ -543,7 +543,7 @@ class ReporterSelector(): # show the report window with selected report try: - self.daemon.start_job("%s:%s" % (report[CD_UID][CD_CONTENT], report[CD_UUID][CD_CONTENT]), force=1) + self.daemon.start_job(report[CD_DUMPDIR][CD_CONTENT], force=1) except Exception, ex: # FIXME #3 dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply # do this async and wait for yum to end with debuginfoinstal @@ -564,7 +564,7 @@ class ReporterSelector(): # when getReport is done it emits "analyze-complete" and on_analyze_complete_cb is called # FIXME: does it make sense to change it to use callback rather then signal emitting? try: - self.daemon.start_job("%s:%s" % (self.dump.getUID(), self.dump.getUUID())) + self.daemon.start_job(self.dump.getDumpDir()) except Exception, ex: # FIXME #3 dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply # do this async and wait for yum to end with debuginfoinstal diff --git a/src/gui/CReporterAssistant.py b/src/gui/CReporterAssistant.py index 5bcd603d..7299b501 100644 --- a/src/gui/CReporterAssistant.py +++ b/src/gui/CReporterAssistant.py @@ -1065,7 +1065,7 @@ class ReporterAssistant(): # when getReport is done it emits "analyze-complete" and on_analyze_complete_cb is called # FIXME: does it make sense to change it to use callback rather then signal emitting? try: - self.daemon.start_job("%s:%s" % (self.report.getUID(), self.report.getUUID()), force) + self.daemon.start_job(self.report.getDumpDir(), force) except Exception, ex: # FIXME #3 dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply # do this async and wait for yum to end with debuginfoinstal |