diff options
author | Aleksey Lim <alsroot@sugarlabs.org> | 2012-08-15 22:26:29 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@sugarlabs.org> | 2012-08-15 22:26:29 (GMT) |
commit | ed3a1ecdf3c5c0029e65f33afb4640cce25cf432 (patch) | |
tree | f45de0212eb5901fbd5e932e1da9a862484b39d6 | |
parent | a5cdc8bf6be0a6651365366499b6440fa150a79a (diff) |
Update bundle properties before emitting bundle signals
-rw-r--r-- | plugin/bundleregistry.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/plugin/bundleregistry.py b/plugin/bundleregistry.py index 44f8b41..dbff344 100644 --- a/plugin/bundleregistry.py +++ b/plugin/bundleregistry.py @@ -193,7 +193,7 @@ class BundleRegistry(gobject.GObject): {'keep_impl': 2, 'limit': 1024}, reply_handler=reply_handler, error_handler=error_handler) - def _add_bundle(self, bundle_id, props=None): + def _add_bundle(self, bundle_id, props): bundle = None for path in checkins(bundle_id): try: @@ -207,8 +207,7 @@ class BundleRegistry(gobject.GObject): _logger.info('No bundles for %r', bundle_id) return None - if props: - bundle.props = props + bundle.props = props self._bundles[bundle.get_bundle_id()] = bundle _logger.info('Add %r bundle', bundle.get_bundle_id()) self.emit('bundle-added', bundle) @@ -229,14 +228,14 @@ class BundleRegistry(gobject.GObject): def _set_keep_impl(self, bundle_id, keep_impl): if keep_impl: + props = get_client().Get('~', 'context', bundle_id, + ['guid', 'keep', 'keep_impl', 'position']) bundle = self._bundles.get(bundle_id) if bundle is None: - bundle = self._add_bundle(bundle_id) + bundle = self._add_bundle(bundle_id, props) else: + bundle.props = props self.emit('bundle-changed', bundle) - if bundle is not None: - bundle.props = get_client().Get('~', 'context', bundle_id, - ['guid', 'keep', 'keep_impl', 'position']) else: self._remove_bundle(bundle_id) |