Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/jarabe/journal/journalentrybundle.py
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2009-11-26 15:45:27 (GMT)
committer Daniel Drake <dsd@laptop.org>2009-11-26 15:45:27 (GMT)
commitd83d3fce34c86a617cb6524e00c3383cece15222 (patch)
tree7a3c4e969672458253de0fa7f3499a2921aee28f /src/jarabe/journal/journalentrybundle.py
parentbd3fdd73a853d618aa5000ff5b1ce82f196c8b70 (diff)
Journal entry bundles shouldn't create a 2nd ds entry
This fixes a problem where "Show in Journal" from a Browse download was broken. This is because the JEB installation code would extract the content from the bundle entry, install it as a new datastore entry, and then delete the bundle entry. This is fixed by making the journal entry from the bundle take over the datastore entry that belonged to the bundle.
Diffstat (limited to 'src/jarabe/journal/journalentrybundle.py')
-rw-r--r--src/jarabe/journal/journalentrybundle.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/jarabe/journal/journalentrybundle.py b/src/jarabe/journal/journalentrybundle.py
index 74b2ac5..9e68c06 100644
--- a/src/jarabe/journal/journalentrybundle.py
+++ b/src/jarabe/journal/journalentrybundle.py
@@ -40,24 +40,24 @@ class JournalEntryBundle(Bundle):
def __init__(self, path):
Bundle.__init__(self, path)
- def install(self, install_path):
+ def install(self, install_path, uid=''):
if os.environ.has_key('SUGAR_ACTIVITY_ROOT'):
install_dir = os.path.join(os.environ['SUGAR_ACTIVITY_ROOT'],
'data')
else:
install_dir = tempfile.gettempdir()
bundle_dir = os.path.join(install_dir, self._zip_root_dir)
- uid = self._zip_root_dir
+ temp_uid = self._zip_root_dir
self._unzip(install_dir)
try:
metadata = self._read_metadata(bundle_dir)
- metadata['uid'] = ''
+ metadata['uid'] = uid
- preview = self._read_preview(uid, bundle_dir)
+ preview = self._read_preview(temp_uid, bundle_dir)
if preview is not None:
metadata['preview'] = dbus.ByteArray(preview)
- file_path = os.path.join(bundle_dir, uid)
+ file_path = os.path.join(bundle_dir, temp_uid)
model.write(metadata, file_path)
finally:
shutil.rmtree(bundle_dir, ignore_errors=True)