Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2009-03-01 13:47:56 (GMT)
committer Tomeu Vizoso <tomeu@sugarlabs.org>2009-03-01 13:47:56 (GMT)
commit92049568b99517c390336d9ae24ce0b125d3fe36 (patch)
tree253bcb8c21895f599515f27ab144955e7aa8a621 /src
parenta6e67afc2cc50ca09ba7b8e7e63e214e35dbc64a (diff)
Avoid reading the bundle twice #442
Diffstat (limited to 'src')
-rw-r--r--src/jarabe/model/bundleregistry.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py
index 62ac6e2..ee440a5 100644
--- a/src/jarabe/model/bundleregistry.py
+++ b/src/jarabe/model/bundleregistry.py
@@ -72,15 +72,7 @@ class BundleRegistry(gobject.GObject):
if not one_file.get_path().endswith('.activity'):
return
if event_type == gio.FILE_MONITOR_EVENT_CREATED:
- try:
- bundle = ActivityBundle(one_file.get_path())
- except MalformedBundleException:
- logging.error('Error loading bundle %r:\n%s' % (
- one_file.get_path(),
- ''.join(traceback.format_exception(*sys.exc_info()))))
- return
- if not self.is_installed(bundle):
- self.add_bundle(one_file.get_path())
+ self.add_bundle(one_file.get_path())
elif event_type == gio.FILE_MONITOR_EVENT_DELETED:
self.remove_bundle(one_file.get_path())
@@ -216,6 +208,9 @@ class BundleRegistry(gobject.GObject):
''.join(traceback.format_exception(*sys.exc_info()))))
return None
+ if self.get_bundle(bundle.get_bundle_id()) is not None:
+ return None
+
self._bundles.append(bundle)
return bundle