[kupfer] plugin.gnome_terminal: Catch error if can't contact gconf



commit 5ab309e212e981237304ec9f94eea2898d785334
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Fri Nov 27 13:54:39 2009 +0100

    plugin.gnome_terminal: Catch error if can't contact gconf

 kupfer/plugin/gnome_terminal.py |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/kupfer/plugin/gnome_terminal.py b/kupfer/plugin/gnome_terminal.py
index 09376c0..442c92b 100644
--- a/kupfer/plugin/gnome_terminal.py
+++ b/kupfer/plugin/gnome_terminal.py
@@ -1,5 +1,7 @@
 import os
 
+import glib
+
 from kupfer.objects import Source, Leaf, Action, \
     AppLeafContentMixin, PicklingHelperMixin
 from kupfer import utils, icons
@@ -51,11 +53,14 @@ class SessionsSource(AppLeafContentMixin, Source, PicklingHelperMixin):
 
 	def get_items(self):
 		gc = gconf.client_get_default()
-		if not gc.dir_exists(GCONF_KEY):
-			return
-
-		for entry in gc.all_dirs(GCONF_KEY):
-			yield Terminal(gc.get_string("%s/visible_name" % entry))
+		try:
+			if not gc.dir_exists(GCONF_KEY):
+				return
+
+			for entry in gc.all_dirs(GCONF_KEY):
+				yield Terminal(gc.get_string("%s/visible_name" % entry))
+		except glib.GError, err:
+			self.output_error(err)
 
 	def should_sort_lexically(self):
 		return True



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]