diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py
index 57db287..d23d5cb 100644
a
|
b
|
|
1 | 1 | # Copyright (C) 2006-2007 Red Hat, Inc. |
| 2 | # Copyright (C) 2009 Aleksey Lim |
2 | 3 | # |
3 | 4 | # This program is free software; you can redistribute it and/or modify |
4 | 5 | # it under the terms of the GNU General Public License as published by |
… |
… |
import gio |
24 | 25 | import cjson |
25 | 26 | |
26 | 27 | from sugar.bundle.activitybundle import ActivityBundle |
| 28 | from sugar.bundle.contentbundle import ContentBundle |
27 | 29 | from sugar.bundle.bundle import MalformedBundleException, \ |
28 | 30 | AlreadyInstalledException, RegistrationException |
29 | 31 | from sugar import env |
… |
… |
class BundleRegistry(gobject.GObject): |
305 | 307 | open(path, 'w').write(cjson.encode(favorites_data)) |
306 | 308 | |
307 | 309 | def is_installed(self, bundle): |
| 310 | # TODO treat ContentBundle in special way |
| 311 | # needs rethinking while fixing ContentBundle support |
| 312 | if isinstance(bundle, ContentBundle): |
| 313 | return bundle.is_installed() |
| 314 | |
308 | 315 | for installed_bundle in self._bundles: |
309 | 316 | if bundle.get_bundle_id() == installed_bundle.get_bundle_id() and \ |
310 | 317 | bundle.get_activity_version() == \ |
… |
… |
class BundleRegistry(gobject.GObject): |
328 | 335 | install_dir = env.get_user_activities_path() |
329 | 336 | install_path = bundle.install(install_dir) |
330 | 337 | |
331 | | if not self.add_bundle(install_path): |
| 338 | # TODO treat ContentBundle in special way |
| 339 | # needs rethinking while fixing ContentBundle support |
| 340 | if isinstance(bundle, ContentBundle): |
| 341 | pass |
| 342 | elif not self.add_bundle(install_path): |
332 | 343 | raise RegistrationException |
333 | 344 | |
334 | 345 | def uninstall(self, bundle, force=False): |
| 346 | # TODO treat ContentBundle in special way |
| 347 | # needs rethinking while fixing ContentBundle support |
| 348 | if isinstance(bundle, ContentBundle): |
| 349 | if bundle.is_installed(): |
| 350 | bundle.uninstall() |
| 351 | else: |
| 352 | logging.warning('Not uninstalling, bundle is not installed') |
| 353 | return |
| 354 | |
335 | 355 | act = self.get_bundle(bundle.get_bundle_id()) |
336 | 356 | if not force and \ |
337 | 357 | act.get_activity_version() != bundle.get_activity_version(): |