Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tacollaboration.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2011-02-07 14:05:17 (GMT)
committer Walter Bender <walter@sugarlabs.org>2011-02-07 14:05:17 (GMT)
commit0f6ec143612b29306e20b0512a8b1ea3b2cb7662 (patch)
treec8be9298a63a252cb228860d123c9f2617c58f83 /TurtleArt/tacollaboration.py
parent050957fe8e2d62d5d89a538c5750edd90900ab29 (diff)
trying base64 for draw_pixbuf sharing
Diffstat (limited to 'TurtleArt/tacollaboration.py')
-rw-r--r--TurtleArt/tacollaboration.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/TurtleArt/tacollaboration.py b/TurtleArt/tacollaboration.py
index 0bebe67..83ce835 100644
--- a/TurtleArt/tacollaboration.py
+++ b/TurtleArt/tacollaboration.py
@@ -225,13 +225,18 @@ class Collaboration():
def _draw_pixbuf(self, payload):
if len(payload) > 0:
- [nick, [a, b, x, y, w, h, width, height, stride,
- bits_per_sample, has_alpha, colorspace, data]] =\
- data_from_string(payload)
+ [nick, [a, b, x, y, w, h, width, height, data]] =\
+ data_from_string(payload)
if nick != self._tw.nick:
- self._tw.canvas.draw_pixbuf(gtk.gdk.pixbuf_new_from_data(
- data, colorspace, has_alpha, bits_per_sample, width,
- height, stride), a, b, x, y, w, h, None, False)
+ if self.tw.running_sugar:
+ tmp_path = get_path(self.tw.activity, 'instance')
+ else:
+ tmp_path = '/tmp'
+ file_name = base64_to_image(data, tmp_path)
+ pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(file_name,
+ width, height)
+ self._tw.canvas.draw_pixbuf(pixbuf, a, b, x, y, w, h,
+ file_name, False)
def _move_forward(self, payload):
if len(payload) > 0: