From 30114f9545f2a95ac5935e92e377896d557abb23 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 10 May 2007 14:16:48 +0200 Subject: [PATCH] Temporary try..excepts while we stabilize the new datastore. --- sugar/activity/activity.py | 5 ++++- sugar/datastore/dbus_helpers.py | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sugar/activity/activity.py b/sugar/activity/activity.py index 809b61a5..fcbccc39 100644 --- a/sugar/activity/activity.py +++ b/sugar/activity/activity.py @@ -193,7 +193,10 @@ class Activity(Window, gtk.Container): f = open(self.jobject.file_path, 'w') f.write('mec') f.close() - datastore.write(self.jobject) + try: + datastore.write(self.jobject) + except Exception, e: + logging.error(e) else: self.jobject = None diff --git a/sugar/datastore/dbus_helpers.py b/sugar/datastore/dbus_helpers.py index f8733ea3..9ec73cf1 100644 --- a/sugar/datastore/dbus_helpers.py +++ b/sugar/datastore/dbus_helpers.py @@ -27,8 +27,12 @@ DS_DBUS_INTERFACE = "org.laptop.sugar.DataStore" DS_DBUS_PATH = "/org/laptop/sugar/DataStore" _bus = dbus.SessionBus() -_data_store = dbus.Interface(_bus.get_object(DS_DBUS_SERVICE, DS_DBUS_PATH), - DS_DBUS_INTERFACE) +try: + _data_store = dbus.Interface(_bus.get_object(DS_DBUS_SERVICE, DS_DBUS_PATH), + DS_DBUS_INTERFACE) +except Exception, e: + _data_store = None + logging.error(e) def create(properties, filename): logging.debug('dbus_helpers.create: %s, %s' % (properties, filename))