deskbar-applet r1870 - in trunk: . deskbar/handlers deskbar/ui/preferences
- From: sebp svn gnome org
- To: svn-commits-list gnome org
- Subject: deskbar-applet r1870 - in trunk: . deskbar/handlers deskbar/ui/preferences
- Date: Fri, 25 Jan 2008 18:52:05 +0000 (GMT)
Author: sebp
Date: Fri Jan 25 18:52:05 2008
New Revision: 1870
URL: http://svn.gnome.org/viewvc/deskbar-applet?rev=1870&view=rev
Log:
Catch dbus.exceptions.DBusException
Modified:
trunk/ChangeLog
trunk/deskbar/handlers/gdmactions.py
trunk/deskbar/handlers/tomboy.py
trunk/deskbar/ui/preferences/DeskbarPreferences.py
Modified: trunk/deskbar/handlers/gdmactions.py
==============================================================================
--- trunk/deskbar/handlers/gdmactions.py (original)
+++ trunk/deskbar/handlers/gdmactions.py Fri Jan 25 18:52:05 2008
@@ -1,10 +1,17 @@
-import dbus, dbus.glib
-from gettext import gettext as _
-import deskbar, deskbar.core.Indexer, deskbar.interfaces.Match, deskbar.interfaces.Module, deskbar.core.Utils
from deskbar.defs import VERSION
+from gettext import gettext as _
+import dbus
+import dbus.glib
+import deskbar
+import deskbar.core.Indexer
+import deskbar.core.Utils
import deskbar.handlers.gdmclient
-import gobject, gtk, gnome.ui
import deskbar.interfaces.Action
+import deskbar.interfaces.Match
+import deskbar.interfaces.Module
+import gnome.ui
+import gobject
+import gtk
HANDLERS = ["GdmHandler"]
@@ -84,7 +91,7 @@
try:
if logout_prompt(PROMPT_SUSPEND):
self._gpm.Suspend()
- except dbus.DBusException:
+ except dbus.exceptions.DBusException:
# this will trigger a method timeout exception.
# As a workaround we swallow it silently
pass
@@ -101,7 +108,7 @@
try:
if logout_prompt(PROMPT_HIBERNATE):
self._gpm.Hibernate()
- except dbus.DBusException:
+ except dbus.exceptions.DBusException:
# this will trigger a method timeout exception.
# As a workaround we swallow it silently
pass
@@ -118,7 +125,7 @@
try:
if logout_prompt(PROMPT_SHUTDOWN):
self._gpm.Shutdown()
- except dbus.DBusException:
+ except dbus.exceptions.DBusException:
# this will trigger a method timeout exception.
# As a workaround we swallow it silently
pass
@@ -139,7 +146,7 @@
def activate(self, text=None):
try:
self._scrsvr.Lock()
- except dbus.DBusException:
+ except dbus.exceptions.DBusException:
# this will trigger a method timeout exception.
# As a workaround we swallow it silently
pass
Modified: trunk/deskbar/handlers/tomboy.py
==============================================================================
--- trunk/deskbar/handlers/tomboy.py (original)
+++ trunk/deskbar/handlers/tomboy.py Fri Jan 25 18:52:05 2008
@@ -10,6 +10,9 @@
from deskbar.handlers.actions.CopyToClipboardAction import CopyToClipboardAction
import gtk
from gettext import gettext as _
+import logging
+
+LOGGER = logging.getLogger(__name__)
HANDLERS = ["TomboyNotesModule"]
@@ -183,15 +186,19 @@
# Check if Tomboy is on DBus
def tomboy_installed():
- bus = dbus.SessionBus()
- proxy = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
- _dbus = dbus.Interface(proxy, 'org.freedesktop.DBus')
- _dbus.ReloadConfig()
- bus_names = _dbus.ListActivatableNames()
- if "org.gnome.Tomboy" in bus_names:
- return True
- else:
- TomboyNotesModule.INSTRUCTIONS = _("Tomboy does not seem to be installed.")
+ try:
+ bus = dbus.SessionBus()
+ proxy = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
+ _dbus = dbus.Interface(proxy, 'org.freedesktop.DBus')
+ _dbus.ReloadConfig()
+ bus_names = _dbus.ListActivatableNames()
+ if "org.gnome.Tomboy" in bus_names:
+ return True
+ else:
+ TomboyNotesModule.INSTRUCTIONS = _("Tomboy does not seem to be installed.")
+ return False
+ except dbus.exceptions.DBusException, e:
+ LOGGER.exception(e)
return False
# Parse Tomboy command line output to get version
Modified: trunk/deskbar/ui/preferences/DeskbarPreferences.py
==============================================================================
--- trunk/deskbar/ui/preferences/DeskbarPreferences.py (original)
+++ trunk/deskbar/ui/preferences/DeskbarPreferences.py Fri Jan 25 18:52:05 2008
@@ -137,12 +137,15 @@
notebook.prev_page()
def __is_nsm_available(self):
- bus = dbus.SessionBus()
- proxy = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
- _dbus = dbus.Interface(proxy, 'org.freedesktop.DBus')
- _dbus.ReloadConfig()
- bus_names = _dbus.ListActivatableNames()
- return (NewStuffUpdater.NEW_STUFF_SERVICE in bus_names)
+ try:
+ bus = dbus.SessionBus()
+ proxy = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
+ _dbus = dbus.Interface(proxy, 'org.freedesktop.DBus')
+ _dbus.ReloadConfig()
+ bus_names = _dbus.ListActivatableNames()
+ return (NewStuffUpdater.NEW_STUFF_SERVICE in bus_names)
+ except dbus.exceptions.DBusException:
+ return False
def __enable_newstuffmanager(self, status):
if status:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]