diff --git a/src/command_system/tools.py b/src/command_system/tools.py index 59253a1520551c601e004580aa86312a25ab7368..a5030792c4bf0faaf8d922b9c2fc24612a238514 100644 --- a/src/command_system/tools.py +++ b/src/command_system/tools.py @@ -25,6 +25,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from types import * +from glib import GError def remove(sequence, target): if isinstance(sequence, ListType): @@ -37,7 +38,7 @@ def remove(sequence, target): def gconf(path): try: from gconf import client_get_default - except ImportError: - return - client = client_get_default() - return client.get_string(path) \ No newline at end of file + client = client_get_default() + return client.get_string(path) + except ImportError, GError: + pass \ No newline at end of file diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py index 217b8ba514f8991b4f9632730b7dfa07464dc875..5f9aa3d569c2d58c6d2a16360f261fce59ead919 100644 --- a/src/gtkgui_helpers.py +++ b/src/gtkgui_helpers.py @@ -173,13 +173,11 @@ def get_default_font(): Xfce and last KDE it returns None on failure or else a string 'Font Size' """ try: - import gconf - # in try because daemon may not be there - client = gconf.client_get_default() - - return client.get_string('/desktop/gnome/interface/font_name' - ).decode('utf-8') - except Exception: + from gconf import client_get_default + client = client_get_default() + value = client.get_string("/desktop/gnome/interface/font_name") + return value.decode("utf8") + except ImportError, glib.GError: pass # try to get Xfce default font