#4618: Make the shell service more resilient to failure.

This commit is contained in:
Tomeu Vizoso 2007-11-03 16:34:17 +01:00
parent bce1c9fa21
commit e748f756c0
2 changed files with 15 additions and 4 deletions

2
NEWS
View File

@ -1,3 +1,5 @@
* #4618: Make the shell service more resilient to failure. (tomeu)
Snapshot 39aca0154d Snapshot 39aca0154d
* Get bundle installation to work again. (marco) * Get bundle installation to work again. (marco)

View File

@ -15,6 +15,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import os import os
import logging
import gobject import gobject
@ -85,14 +86,22 @@ class BundleRegistry(gobject.GObject):
for f in os.listdir(path): for f in os.listdir(path):
if not f.endswith('.activity'): if not f.endswith('.activity'):
continue continue
bundle_dir = os.path.join(path, f) try:
if os.path.isdir(bundle_dir): bundle_dir = os.path.join(path, f)
bundles[bundle_dir] = os.stat(bundle_dir).st_mtime 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 = bundles.keys()
bundle_dirs.sort(lambda d1,d2: cmp(bundles[d1], bundles[d2])) bundle_dirs.sort(lambda d1,d2: cmp(bundles[d1], bundles[d2]))
for dir in bundle_dirs: 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): def add_bundle(self, bundle_path):
try: try: