From e748f756c0d433349421fe613809bf5c6912e1ea Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Sat, 03 Nov 2007 15:34:17 +0000 Subject: #4618: Make the shell service more resilient to failure. --- diff --git a/NEWS b/NEWS index b70388a..d5d4dbc 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +* #4618: Make the shell service more resilient to failure. (tomeu) + Snapshot 39aca0154d * Get bundle installation to work again. (marco) diff --git a/services/shell/bundleregistry.py b/services/shell/bundleregistry.py index cbf5464..8dd141c 100644 --- a/services/shell/bundleregistry.py +++ b/services/shell/bundleregistry.py @@ -15,6 +15,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import os +import logging import gobject @@ -85,14 +86,22 @@ class BundleRegistry(gobject.GObject): for f in os.listdir(path): if not f.endswith('.activity'): continue - bundle_dir = os.path.join(path, f) - if os.path.isdir(bundle_dir): - bundles[bundle_dir] = os.stat(bundle_dir).st_mtime + try: + bundle_dir = os.path.join(path, f) + if os.path.isdir(bundle_dir): + bundles[bundle_dir] = os.stat(bundle_dir).st_mtime + except Exception, e: + logging.error('Error while processing installed activity ' \ + 'bundle: %s, %s, %s' % (f, e.__class__, e)) bundle_dirs = bundles.keys() bundle_dirs.sort(lambda d1,d2: cmp(bundles[d1], bundles[d2])) for dir in bundle_dirs: - self.add_bundle(dir) + try: + self.add_bundle(dir) + except Exception, e: + logging.error('Error while processing installed activity ' \ + 'bundle: %s, %s, %s' % (dir, e.__class__, e)) def add_bundle(self, bundle_path): try: -- cgit v0.9.1