diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2009-07-27 04:05:14 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@sugarlabs.org> | 2009-07-27 10:27:42 (GMT) |
commit | d1239c388005c4b6fc677849b810a99ac3586531 (patch) | |
tree | eac212fc47d927d4ef9e394bf026ed6321e7abfe /src | |
parent | 81eaa9b6f39e7810c5b57898986e50902644fa43 (diff) |
Fix .xoj support #1098
Diffstat (limited to 'src')
-rw-r--r-- | src/jarabe/journal/journalactivity.py | 1 | ||||
-rw-r--r-- | src/jarabe/journal/journalentrybundle.py | 5 | ||||
-rw-r--r-- | src/jarabe/model/bundleregistry.py | 10 |
3 files changed, 12 insertions, 4 deletions
diff --git a/src/jarabe/journal/journalactivity.py b/src/jarabe/journal/journalactivity.py index 9939a7a..80204a1 100644 --- a/src/jarabe/journal/journalactivity.py +++ b/src/jarabe/journal/journalactivity.py @@ -287,6 +287,7 @@ class JournalActivity(Window): if metadata['mime_type'] == JournalEntryBundle.MIME_TYPE: model.delete(object_id) + return metadata['bundle_id'] = bundle.get_bundle_id() model.write(metadata) diff --git a/src/jarabe/journal/journalentrybundle.py b/src/jarabe/journal/journalentrybundle.py index 5d4086c..ebe7ec3 100644 --- a/src/jarabe/journal/journalentrybundle.py +++ b/src/jarabe/journal/journalentrybundle.py @@ -40,7 +40,7 @@ class JournalEntryBundle(Bundle): def __init__(self, path): Bundle.__init__(self, path) - def install(self): + def install(self, install_path): if os.environ.has_key('SUGAR_ACTIVITY_ROOT'): install_dir = os.path.join(os.environ['SUGAR_ACTIVITY_ROOT'], 'data') @@ -62,6 +62,9 @@ class JournalEntryBundle(Bundle): finally: shutil.rmtree(bundle_dir, ignore_errors=True) + def get_bundle_id(self): + return None + def _read_metadata(self, bundle_dir): metadata_path = os.path.join(bundle_dir, '_metadata.json') if not os.path.exists(metadata_path): diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py index 42a599f..2155208 100644 --- a/src/jarabe/model/bundleregistry.py +++ b/src/jarabe/model/bundleregistry.py @@ -26,6 +26,7 @@ import cjson from sugar.bundle.activitybundle import ActivityBundle from sugar.bundle.contentbundle import ContentBundle +from jarabe.journal.journalentrybundle import JournalEntryBundle from sugar.bundle.bundle import MalformedBundleException, \ AlreadyInstalledException, RegistrationException from sugar import env @@ -315,7 +316,8 @@ class BundleRegistry(gobject.GObject): def is_installed(self, bundle): # TODO treat ContentBundle in special way # needs rethinking while fixing ContentBundle support - if isinstance(bundle, ContentBundle): + if isinstance(bundle, ContentBundle) or \ + isinstance(bundle, JournalEntryBundle): return bundle.is_installed() for installed_bundle in self._bundles: @@ -344,7 +346,8 @@ class BundleRegistry(gobject.GObject): # TODO treat ContentBundle in special way # needs rethinking while fixing ContentBundle support - if isinstance(bundle, ContentBundle): + if isinstance(bundle, ContentBundle) or \ + isinstance(bundle, JournalEntryBundle): pass elif not self.add_bundle(install_path): raise RegistrationException @@ -352,7 +355,8 @@ class BundleRegistry(gobject.GObject): def uninstall(self, bundle, force=False): # TODO treat ContentBundle in special way # needs rethinking while fixing ContentBundle support - if isinstance(bundle, ContentBundle): + if isinstance(bundle, ContentBundle) or \ + isinstance(bundle, JournalEntryBundle): if bundle.is_installed(): bundle.uninstall() else: |