diff options
author | Karel Klic <kklic@redhat.com> | 2010-02-01 16:06:52 +0100 |
---|---|---|
committer | Karel Klic <kklic@redhat.com> | 2010-02-01 16:06:52 +0100 |
commit | e45356512a661c4dd1d4d18bc40c37a3ffb3b989 (patch) | |
tree | 9fb3e08e1b5c74e683a91045152b08ca7cab5997 /src | |
parent | 19359090b7cfacacb8d1b803211057e16c53becb (diff) | |
parent | 280ef1e68789ef7ef82048b8a772a57203750495 (diff) | |
download | abrt-e45356512a661c4dd1d4d18bc40c37a3ffb3b989.tar.gz abrt-e45356512a661c4dd1d4d18bc40c37a3ffb3b989.tar.xz abrt-e45356512a661c4dd1d4d18bc40c37a3ffb3b989.zip |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'src')
-rw-r--r-- | src/Applet/Applet.cpp | 3 | ||||
-rw-r--r-- | src/Gui/ABRTPlugin.py | 2 | ||||
-rw-r--r-- | src/Gui/CCDBusBackend.py | 7 | ||||
-rw-r--r-- | src/Gui/CCDump.py | 6 | ||||
-rw-r--r-- | src/Gui/CCDumpList.py | 4 | ||||
-rw-r--r-- | src/Gui/CCMainWindow.py | 37 | ||||
-rw-r--r-- | src/Gui/CC_gui_functions.py | 30 | ||||
-rw-r--r-- | src/Gui/ConfBackend.py | 7 | ||||
-rw-r--r-- | src/Gui/PluginList.py | 1 | ||||
-rw-r--r-- | src/Gui/abrt_utils.py | 2 | ||||
-rw-r--r-- | src/Gui/dialogs.glade | 1 | ||||
-rw-r--r-- | src/Hooks/abrt-hook-ccpp.cpp | 7 |
12 files changed, 52 insertions, 55 deletions
diff --git a/src/Applet/Applet.cpp b/src/Applet/Applet.cpp index b17a88b7..c29a164d 100644 --- a/src/Applet/Applet.cpp +++ b/src/Applet/Applet.cpp @@ -247,12 +247,11 @@ int main(int argc, char** argv) die_if_dbus_error(r != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER, &err, "Problem connecting to dbus, or applet is already running"); - /* Show disabled icon if daemon is not running */ + /* show the warning in terminal, as nm-applet does */ if (!dbus_bus_name_has_owner(system_conn, ABRTD_DBUS_NAME, &err)) { const char* msg = _("ABRT service is not running"); puts(msg); - applet->Disable(msg); } /* dbus_bus_request_name can already read some data. Thus while dbus fd hasn't diff --git a/src/Gui/ABRTPlugin.py b/src/Gui/ABRTPlugin.py index f32a5935..c54f670c 100644 --- a/src/Gui/ABRTPlugin.py +++ b/src/Gui/ABRTPlugin.py @@ -21,7 +21,6 @@ class PluginSettings(dict): self.client_side_conf = getCurrentConfBackend() except ConfBackendInitError, e: print e - pass def check(self): # if present, these should be non-empty @@ -47,7 +46,6 @@ class PluginSettings(dict): settings = self.client_side_conf.load(name) except Exception, e: print e - pass # overwrite daemon data with user setting for key in settings.keys(): # only rewrite keys which exist in plugin's keys. diff --git a/src/Gui/CCDBusBackend.py b/src/Gui/CCDBusBackend.py index 1ab0e3a8..d1572236 100644 --- a/src/Gui/CCDBusBackend.py +++ b/src/Gui/CCDBusBackend.py @@ -4,7 +4,6 @@ import gobject import dbus import dbus.service from dbus.mainloop.glib import DBusGMainLoop -import gtk from dbus.exceptions import * import ABRTExceptions from abrt_utils import _, log, log1, log2 @@ -35,7 +34,7 @@ class DBusManager(gobject.GObject): self.dbusmanager.emit("show") try: session = dbus.SessionBus() - except Exception, e: + except Exception: # probably run after "$ su" pass @@ -107,7 +106,7 @@ class DBusManager(gobject.GObject): # rc is either self.bus.START_REPLY_SUCCESS or self.bus.START_REPLY_ALREADY_RUNNING if rc == self.bus.START_REPLY_SUCCESS: # Better solution may be to have daemon emit a signal and wait for it - log1("dbus auto-started abrt daemon, giving it 1 sec to initialize"); + log1("dbus auto-started abrt daemon, giving it 1 sec to initialize") time.sleep(1) except DBusException: raise Exception("abrt daemon is not running, and DBus can't start it") @@ -200,7 +199,7 @@ class DBusManager(gobject.GObject): row_dict = {} for column in row: row_dict[column] = row[column] - rows.append(row_dict); + rows.append(row_dict) return rows def getPluginsInfo(self): diff --git a/src/Gui/CCDump.py b/src/Gui/CCDump.py index 1f290929..2bb55dd0 100644 --- a/src/Gui/CCDump.py +++ b/src/Gui/CCDump.py @@ -79,11 +79,11 @@ class Dump(): #return self.Message[CD_CONTENT].split('\n') return self.Message[CD_CONTENT] - def getTime(self, format): + def getTime(self, fmt): #print format - if format: + if fmt: try: - return datetime.fromtimestamp(int(self.time[CD_CONTENT])).strftime(format) + return datetime.fromtimestamp(int(self.time[CD_CONTENT])).strftime(fmt) except Exception, e: print e return int(self.time[CD_CONTENT]) diff --git a/src/Gui/CCDumpList.py b/src/Gui/CCDumpList.py index 9888b10f..9d6bb2a2 100644 --- a/src/Gui/CCDumpList.py +++ b/src/Gui/CCDumpList.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -import CCDBusBackend from CCDump import Dump from abrt_utils import _, init_logging, log, log1, log2 @@ -7,6 +6,7 @@ from abrt_utils import _, init_logging, log, log1, log2 class DumpList(list): """Class to store list of debug dumps""" def __init__(self,dbus_manager=None): + list.__init__(self) self.dm = dbus_manager def load(self): @@ -21,7 +21,7 @@ class DumpList(list): log2(" DumpList.%s='%s'", column, row[column]) entry.__dict__[column] = row[column] self.append(entry) - except Exception, e: + except Exception: # FIXME handle exception better # this is just temporary workaround for rhbz#543725 raise diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index b7b571d1..0d9b0a2e 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- import sys -import os import pwd import getopt @@ -16,15 +15,11 @@ except RuntimeError,e: print e sys.exit() import gtk.glade -try: - import rpm -except Exception, ex: - rpm = None from ConfBackend import getCurrentConfBackend, ConfBackendInitError import CCDBusBackend from CC_gui_functions import * -from CCDumpList import getDumpList, DumpList +from CCDumpList import getDumpList from CCDump import * # FILENAME_xxx, CD_xxx from CCReporterDialog import ReporterDialog from PluginsSettingsDialog import PluginsSettingsDialog @@ -40,12 +35,12 @@ class MainWindow(): self.updates = "" try: self.ccdaemon = CCDBusBackend.DBusManager() - except ABRTExceptions.IsRunning, e: + except ABRTExceptions.IsRunning: # another instance is running, so exit quietly sys.exit() - except Exception, e: + except Exception, ex: # show error message if connection fails - gui_error_message("%s" % e) + gui_error_message("%s" % ex) sys.exit() #Set the Glade file self.gladefile = "%s/ccgui.glade" % sys.path[0] @@ -165,7 +160,7 @@ class MainWindow(): try: gobject.source_remove(self.timer) self.pBarWindow.hide() - except Exception, e: + except Exception: pass gui_error_message(_("Unable to finish current task!\n%s" % message), parent_dialog=self.window) @@ -192,9 +187,9 @@ class MainWindow(): self.dumpsListStore.clear() try: dumplist = getDumpList(self.ccdaemon, refresh=True) - except Exception, e: + except Exception, ex: # there is something wrong with the daemon if we cant get the dumplist - gui_error_message(_("Error while loading the dumplist.\n%s" % e)) + gui_error_message(_("Error while loading the dumplist.\n%s" % ex)) # so we shouldn't continue.. sys.exit() for entry in dumplist[::-1]: @@ -206,7 +201,7 @@ class MainWindow(): if entry.getUID() != "-1": try: user = pwd.getpwuid(int(entry.getUID()))[0] - except Exception, e: + except Exception, ex: user = "UID: %s" % entry.getUID() n = self.dumpsListStore.append([icon, entry.getPackage(), entry.getExecutable(), entry.getTime("%c"), entry.getCount(), user, entry.isReported(), entry]) @@ -264,8 +259,8 @@ class MainWindow(): self.ccdaemon.DeleteDebugDump(dump.getUUID()) self.hydrate() treeview.emit("cursor-changed") - except Exception, e: - print e + except Exception, ex: + print ex def destroy(self, widget, data=None): gtk.main_quit() @@ -319,8 +314,8 @@ class MainWindow(): self.ccdaemon.Report(result, reporters_settings) log2("Report() returned") #self.hydrate() - except Exception, e: - gui_error_message(_("Reporting failed!\n%s" % e)) + except Exception, ex: + gui_error_message(_("Reporting failed!\n%s" % ex)) # -50 == REFRESH elif response == -50: self.refresh_report(report) @@ -333,13 +328,13 @@ class MainWindow(): # show the report window with selected report try: self.ccdaemon.getReport(report[CD_UUID][CD_CONTENT], force=1) - except Exception, e: + 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 if self.timer: gobject.source_remove(self.timer) self.pBarWindow.hide() - gui_error_message(_("Error getting the report: %s" % e)) + gui_error_message(_("Error getting the report: %s" % ex)) return def on_bReport_clicked(self, button): @@ -360,13 +355,13 @@ class MainWindow(): # show the report window with selected dump try: self.ccdaemon.getReport(dump.getUUID()) - except Exception, e: + 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 if self.timer: gobject.source_remove(self.timer) self.pBarWindow.hide() - gui_error_message(_("Error getting the report: %s" % e)) + gui_error_message(_("Error getting the report: %s" % ex)) return def sw_delete_event_cb(self, widget, event, data=None): diff --git a/src/Gui/CC_gui_functions.py b/src/Gui/CC_gui_functions.py index d92e26f3..9378de52 100644 --- a/src/Gui/CC_gui_functions.py +++ b/src/Gui/CC_gui_functions.py @@ -14,11 +14,14 @@ else: try: # we don't want to add dependency to rpm, but if we have it, we can use it import rpm -except: +except ImportError: rpm = None from abrt_utils import _, log, log1, log2 +def on_label_resize(label, allocation): + label.set_size_request(allocation.width,-1) + def on_url_clicked(label, url): import gnomevfs file_mimetype = gnomevfs.get_mime_type(url) @@ -35,13 +38,12 @@ def gui_report_dialog ( report_status_dict, parent_dialog, builderfile = "%s%sdialogs.glade" % (sys.path[0],"/") builder.add_from_file(builderfile) dialog = builder.get_object("ReportDialog") - dialog.set_default_size(400, 50) - dialog.set_resizable(False) + dialog.set_geometry_hints(dialog, min_width=450, min_height=150) + dialog.set_resizable(True) main_hbox = builder.get_object("main_hbox") STATUS = 0 MESSAGE = 1 - message = "" status_vbox = gtk.VBox() for plugin, res in report_status_dict.iteritems(): plugin_status_vbox = gtk.VBox() @@ -50,6 +52,7 @@ def gui_report_dialog ( report_status_dict, parent_dialog, plugin_label.set_justify(gtk.JUSTIFY_RIGHT) plugin_label.set_alignment(0, 0) status_label = gtk.Label() + status_label.connect("size-allocate",on_label_resize) status_label.set_max_width_chars(MAX_WIDTH) status_label.set_size_request(400,-1) status_label.set_selectable(True) @@ -59,23 +62,22 @@ def gui_report_dialog ( report_status_dict, parent_dialog, plugin_status_vbox.pack_start(plugin_label, expand=False) plugin_status_vbox.pack_start(status_label, fill=True, expand=True) # 0 means not succesfull - #if report_status_dict[plugin][0] == '0': + #if report_status_dict[plugin][STATUS] == '0': # this first one is actually a fallback to set at least # a raw text in case when set_markup() fails - status_label.set_text(report_status_dict[plugin][1]) - status_label.set_markup("<span foreground='red'>%s</span>" % report_status_dict[plugin][1]) + status_label.set_text(report_status_dict[plugin][MESSAGE]) + status_label.set_markup("<span foreground='red'>%s</span>" % report_status_dict[plugin][MESSAGE]) # if the report was not succesful then this won't pass so this runs only # if report succeds and gets overwriten by the status message - if report_status_dict[plugin][0] == '1': - if "http" in report_status_dict[plugin][1][0:4] or "file://" in report_status_dict[plugin][1][0:7]: - status_label.set_markup("<a href=\"%s\">%s</a>" % (report_status_dict[plugin][1], report_status_dict[plugin][1])) + if report_status_dict[plugin][STATUS] == '1': + if "http" in report_status_dict[plugin][MESSAGE][0:4] or "file://" in report_status_dict[plugin][MESSAGE][0:7]: + status_label.set_markup("<a href=\"%s\">%s</a>" % (report_status_dict[plugin][MESSAGE], report_status_dict[plugin][MESSAGE])) # FIXME: make a new branch for rawhide with gtk 2.17 and remove this if gtk.gtk_version[1] < 17: status_label.connect(on_url_clicked_signal, on_url_clicked) else: status_label.set_text("%s" % report_status_dict[plugin][1]) if len(report_status_dict[plugin][1]) > MAX_WIDTH: - print "setting tooltip for %s" % report_status_dict[plugin][1] status_label.set_tooltip_text(report_status_dict[plugin][1]) status_vbox.pack_start(plugin_status_vbox, fill=True, expand=False) main_hbox.pack_start(status_vbox) @@ -203,7 +205,7 @@ def get_icon_for_package(theme, package): # .dektop file found for filename in h['filenames']: if filename.rfind("%s.png" % icon_filename) != -1: - log2("png file:'%s'", filename) + log2("png file:'%s'", filename) icon_filename = filename break #we didn't find the .desktop file @@ -221,7 +223,7 @@ def get_icon_for_package(theme, package): else: return None -def show_log(log, parent=None): +def show_log(message_log, parent=None): builder = gtk.Builder() builderfile = "%s%sdialogs.glade" % (sys.path[0],"/") builder.add_from_file(builderfile) @@ -235,7 +237,7 @@ def show_log(log, parent=None): dialog.set_position (gtk.WIN_POS_CENTER) buff = gtk.TextBuffer() - buff.set_text(log) + buff.set_text(message_log) tevLog.set_buffer(buff) dialog.run() diff --git a/src/Gui/ConfBackend.py b/src/Gui/ConfBackend.py index 741f2009..a76873b5 100644 --- a/src/Gui/ConfBackend.py +++ b/src/Gui/ConfBackend.py @@ -114,7 +114,7 @@ class ConfBackendGnomeKeyring(ConfBackend): settings_tmp, # attrs password, # secret True) - except gkey.DeniedError, e: + except gkey.DeniedError: raise ConfBackendSaveError(_("Access to gnome-keyring has been denied, plugins settings won't be saved.")) def load(self, name): @@ -144,12 +144,11 @@ class ConfBackendGnomeKeyring(ConfBackend): except gkey.NoMatchError: # nothing found pass - except gkey.DeniedError, e: + except gkey.DeniedError: attempts -= 1 log2("gk-authorization has failed %i time(s)", 2-attempts) if attempts == 0: # we tried 2 times, so giving up the authorization - print "raising exception" raise ConfBackendLoadError(_("Access to gnome-keyring has been denied, can't load the settings for %s!" % name)) continue break @@ -229,7 +228,7 @@ class ConfBackendGnomeKeyring(ConfBackend): del attrs["Application"] except: pass - retval[plugin_name] = attrs; + retval[plugin_name] = attrs return retval diff --git a/src/Gui/PluginList.py b/src/Gui/PluginList.py index 82759ae3..6105b04e 100644 --- a/src/Gui/PluginList.py +++ b/src/Gui/PluginList.py @@ -6,6 +6,7 @@ from abrt_utils import _, log, log1, log2 class PluginInfoList(list): """Class to store list of PluginInfos""" def __init__(self,dbus_manager=None): + list.__init__(self) self.dm = dbus_manager def load(self): diff --git a/src/Gui/abrt_utils.py b/src/Gui/abrt_utils.py index 13ef499f..239fd841 100644 --- a/src/Gui/abrt_utils.py +++ b/src/Gui/abrt_utils.py @@ -15,7 +15,7 @@ def init_logging(progname, v): g_verbose = v try: locale.setlocale(locale.LC_ALL, "") - except locale.Error, e: + except locale.Error: import os os.environ['LC_ALL'] = 'C' locale.setlocale(locale.LC_ALL, "") diff --git a/src/Gui/dialogs.glade b/src/Gui/dialogs.glade index 77e78ddc..64e14011 100644 --- a/src/Gui/dialogs.glade +++ b/src/Gui/dialogs.glade @@ -5,7 +5,6 @@ <object class="GtkDialog" id="ReportDialog"> <property name="border_width">6</property> <property name="title" translatable="yes">Report done</property> - <property name="resizable">False</property> <property name="modal">True</property> <property name="window_position">center-on-parent</property> <property name="destroy_with_parent">True</property> diff --git a/src/Hooks/abrt-hook-ccpp.cpp b/src/Hooks/abrt-hook-ccpp.cpp index b844be70..ff062341 100644 --- a/src/Hooks/abrt-hook-ccpp.cpp +++ b/src/Hooks/abrt-hook-ccpp.cpp @@ -77,9 +77,14 @@ int main(int argc, char** argv) int signal_no = xatoi_u(argv[3]); uid_t uid = xatoi_u(argv[4]); off_t ulimit_c = strtoull(argv[5], NULL, 10); + if (ulimit_c < 0) /* unlimited? */ + { + /* set to max possible >0 value */ + ulimit_c = ~((off_t)1 << (sizeof(off_t)*8-1)); + } off_t core_size = 0; - if (errno || pid <= 0 || ulimit_c < 0) + if (errno || pid <= 0) { error_msg_and_die("pid '%s' or limit '%s' is bogus", argv[2], argv[5]); } |