summaryrefslogtreecommitdiffstats
path: root/src/Gui/ABRTPlugin.py
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-10-22 16:56:00 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-10-22 16:56:00 +0200
commit6c0ebcba31940fe8b622eafeb7aa96e5209f5738 (patch)
treea6c74759633b1aa914258374df2299c18ab8661a /src/Gui/ABRTPlugin.py
parentd478476d72ae923db3b843e921254383bd4b1cd6 (diff)
downloadabrt-6c0ebcba31940fe8b622eafeb7aa96e5209f5738.tar.gz
abrt-6c0ebcba31940fe8b622eafeb7aa96e5209f5738.tar.xz
abrt-6c0ebcba31940fe8b622eafeb7aa96e5209f5738.zip
GUI: fixed problem with keyring when run after "su -"
- keyring daemon works only for the session owner so, if user "su" to other user abrt will fail to read/write any settings and will load the defaults, user still can change the settings and use them, but it will be lost when he quit the gui
Diffstat (limited to 'src/Gui/ABRTPlugin.py')
-rw-r--r--src/Gui/ABRTPlugin.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/Gui/ABRTPlugin.py b/src/Gui/ABRTPlugin.py
index 8d687f83..8483be44 100644
--- a/src/Gui/ABRTPlugin.py
+++ b/src/Gui/ABRTPlugin.py
@@ -11,12 +11,17 @@ Email
Description
"""
from abrt_utils import _
-from ConfBackend import ConfBackendGnomeKeyring
+from ConfBackend import ConfBackendGnomeKeyring, ConfBackendInitError
class PluginSettings(dict):
def __init__(self):
dict.__init__(self)
- self.conf = ConfBackendGnomeKeyring()
+ self.conf = None
+ try:
+ self.conf = ConfBackendGnomeKeyring()
+ except ConfBackendInitError, e:
+ print e
+ pass
def check(self):
for key in ["Password", "Login"]:
@@ -32,16 +37,18 @@ class PluginSettings(dict):
for key in default_settings.keys():
self[str(key)] = str(default_settings[key])
- settings = self.conf.load(name)
- # overwrite defaluts with user setting
- for key in settings.keys():
- # only rewrite keys needed by the plugin
- # e.g we don't want a pass field for logger
- if key in default_settings.keys():
- self[str(key)] = str(settings[key])
+ if self.conf:
+ settings = self.conf.load(name)
+ # overwrite defaluts with user setting
+ for key in settings.keys():
+ # only rewrite keys needed by the plugin
+ # e.g we don't want a pass field for logger
+ if key in default_settings.keys():
+ self[str(key)] = str(settings[key])
def save(self, name):
- self.conf.save(name, self)
+ if self.conf:
+ self.conf.save(name, self)
class PluginInfo():
"""Class to represent common plugin info"""