Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-07-27 04:05:14 (GMT)
committer Tomeu Vizoso <tomeu@sugarlabs.org>2009-07-27 10:29:04 (GMT)
commit22cf90c7a23fdf1687b6c4a75c64aa9c95d7c8a3 (patch)
tree7d10bbc0c8517867758de7fec8ede3521d7d2a90
parent5051e799c48693423e2cae63f5d74a4f1f8d6fd1 (diff)
Fix .xoj support #1098
-rw-r--r--src/jarabe/journal/journalactivity.py1
-rw-r--r--src/jarabe/journal/journalentrybundle.py5
-rw-r--r--src/jarabe/model/bundleregistry.py10
3 files changed, 12 insertions, 4 deletions
diff --git a/src/jarabe/journal/journalactivity.py b/src/jarabe/journal/journalactivity.py
index 4ca751c..bc0ba14 100644
--- a/src/jarabe/journal/journalactivity.py
+++ b/src/jarabe/journal/journalactivity.py
@@ -288,6 +288,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 42d39b0..351459b 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
@@ -309,7 +310,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:
@@ -338,7 +340,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
@@ -346,7 +349,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: