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.bender@gmail.com>2011-03-14 12:43:32 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-03-14 12:43:32 (GMT)
commit18f75d3a8c8fbc42bff3638f544ad61edfc15f92 (patch)
treeac9097800aeb619c84884be62966ba1342f0fa3c /TurtleArt/tacollaboration.py
parentbde0306a2345bddb991f8107c809136b6b0f5868 (diff)
more robust switching between turtles on select; don't save remote turtles
Diffstat (limited to 'TurtleArt/tacollaboration.py')
-rw-r--r--TurtleArt/tacollaboration.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/TurtleArt/tacollaboration.py b/TurtleArt/tacollaboration.py
index 4955777..51ba471 100644
--- a/TurtleArt/tacollaboration.py
+++ b/TurtleArt/tacollaboration.py
@@ -98,7 +98,8 @@ class Collaboration():
self.initiating = True
self.waiting_for_turtles = False
self._tw.turtle_dictionary = self._get_dictionary()
-
+ self._tw.remote_turtles = []
+
debug_output('I am sharing...', self._tw.running_sugar)
self.conn = self._shared_activity.telepathy_conn
@@ -216,6 +217,10 @@ class Collaboration():
self._tw.turtle_dictionary[nick] = colors
else:
self._tw.turtle_dictionary = {nick: colors}
+ if hasattr(self._tw, 'remote_turtles'):
+ self._tw.remote_turtles.append(nick)
+ else:
+ self._tw.remote_turtles = [nick]
# Add new turtle for the joiner.
self._tw.canvas.set_turtle(nick, colors)
self._tw.label_remote_turtle(nick)
@@ -229,7 +234,8 @@ class Collaboration():
if len(payload) > 0:
self._tw.turtle_dictionary = data_from_string(payload)
for nick in self._tw.turtle_dictionary:
- if nick != self._tw.nick:
+ if nick != self._tw.nick and \
+ nick in self._tw.remote_turtles:
colors = self._tw.turtle_dictionary[nick]
# add new turtle for the joiner
self._tw.canvas.set_turtle(nick, colors)