From ea262ce3185d068f42c5d0a4b188f0c70b65a2af Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Thu, 17 Jan 2008 15:14:25 +0000 Subject: [PATCH] 2008-01-17 Benny Malengier * src/plugins/WriteCD.py: check if gnome is the desktop, #1599 svn: r9868 --- ChangeLog | 3 +++ src/plugins/WriteCD.py | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 300202e43..3fb873eff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2008-01-17 Benny Malengier + * src/plugins/WriteCD.py: check if gnome is the desktop, #1599 + 2008-01-17 Raphael Ackermann * src/ArgHandler.py: 0001588: -a summary does nothing diff --git a/src/plugins/WriteCD.py b/src/plugins/WriteCD.py index 036f14c0d..19286ae9b 100644 --- a/src/plugins/WriteCD.py +++ b/src/plugins/WriteCD.py @@ -49,6 +49,12 @@ import gtk import gtk.glade import Errors +#This is a GNOME only plugin +_gnome_session = os.getenv('GNOME_DESKTOP_SESSION_ID') +if not _gnome_session: + raise Errors.UnavailableError( + _("WriteCD is a GNOME plugin and you are not running GNOME")) + try: import gnome except ImportError: @@ -57,9 +63,11 @@ except ImportError: "for GNOME are not installed")) try: - from gnomevfs import URI, create, OPEN_WRITE, make_directory, FileExistsError + from gnomevfs import URI, create, OPEN_WRITE, make_directory, \ + FileExistsError except: - from gnome.vfs import URI, create, OPEN_WRITE, make_directory, FileExistsError + from gnome.vfs import URI, create, OPEN_WRITE, make_directory, \ + FileExistsError #------------------------------------------------------------------------- #