Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-10-05 20:39:45 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-10-05 20:39:45 (GMT)
commiteeae5d011f696b68a16e9b6a35451cda3308a381 (patch)
treef8c248e257b06fb72ada656eac722351703628f8
parent32ecdd8ad628edd6affa6a0d4496a121b5a67a53 (diff)
Save activity previews to the datastore as binary png images.
-rw-r--r--NEWS2
-rw-r--r--sugar/activity/activity.py6
-rw-r--r--sugar/datastore/dbus_helpers.py2
3 files changed, 5 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 4c076b8..3b6b15b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+* Save activity previews to the datastore as binary png images. (tomeu)
+
Snapshot acca55e861
* #3905 Wait 3 seconds, rather than 3000, if NetworkManager doesn't respond
diff --git a/sugar/activity/activity.py b/sugar/activity/activity.py
index b3bbcba..ca71110 100644
--- a/sugar/activity/activity.py
+++ b/sugar/activity/activity.py
@@ -449,9 +449,7 @@ class Activity(Window, gtk.Container):
f.close()
os.remove(file_path)
- # TODO: Take this out when the datastore accepts binary data.
- import base64
- return base64.b64encode(preview_data)
+ return preview_data
def _get_buddies(self):
if self._shared_activity is not None:
@@ -481,7 +479,7 @@ class Activity(Window, gtk.Container):
if self._preview is None:
self.metadata['preview'] = ''
else:
- self.metadata['preview'] = self._preview
+ self.metadata['preview'] = dbus.ByteArray(self._preview)
try:
if self._jobject.file_path:
diff --git a/sugar/datastore/dbus_helpers.py b/sugar/datastore/dbus_helpers.py
index a10feec..752b0cc 100644
--- a/sugar/datastore/dbus_helpers.py
+++ b/sugar/datastore/dbus_helpers.py
@@ -67,7 +67,7 @@ def delete(uid):
def get_properties(uid):
logging.debug('dbus_helpers.get_properties: %s' % uid)
- return _get_data_store().get_properties(uid)
+ return _get_data_store().get_properties(uid, byte_arrays=True)
def get_filename(uid):
filename = _get_data_store().get_filename(uid)