summaryrefslogtreecommitdiffstats
path: root/src/Gui
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2010-01-30 21:33:42 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2010-01-30 21:33:42 +0100
commit226ad13b9324fdd5165a1158e310cebd0440aaf7 (patch)
treefc13e1613225e4e9037418a249e1c800d83de241 /src/Gui
parentd49543d341681d0ab24ba58f7316fe155472573e (diff)
downloadabrt-226ad13b9324fdd5165a1158e310cebd0440aaf7.tar.gz
abrt-226ad13b9324fdd5165a1158e310cebd0440aaf7.tar.xz
abrt-226ad13b9324fdd5165a1158e310cebd0440aaf7.zip
GUI: fixed some pylint warnings
Diffstat (limited to 'src/Gui')
-rw-r--r--src/Gui/ABRTPlugin.py2
-rw-r--r--src/Gui/CCDBusBackend.py7
-rw-r--r--src/Gui/CCDump.py6
-rw-r--r--src/Gui/CCDumpList.py4
-rw-r--r--src/Gui/CCMainWindow.py37
-rw-r--r--src/Gui/CC_gui_functions.py21
-rw-r--r--src/Gui/ConfBackend.py7
-rw-r--r--src/Gui/PluginList.py1
-rw-r--r--src/Gui/abrt_utils.py2
9 files changed, 39 insertions, 48 deletions
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 26707538..9378de52 100644
--- a/src/Gui/CC_gui_functions.py
+++ b/src/Gui/CC_gui_functions.py
@@ -14,7 +14,7 @@ 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
@@ -44,7 +44,6 @@ def gui_report_dialog ( report_status_dict, parent_dialog,
STATUS = 0
MESSAGE = 1
- message = ""
status_vbox = gtk.VBox()
for plugin, res in report_status_dict.iteritems():
plugin_status_vbox = gtk.VBox()
@@ -63,16 +62,16 @@ 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)
@@ -206,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
@@ -224,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)
@@ -238,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, "")