diff options
author | Walter Bender <walter@sugarlabs.org> | 2011-02-01 16:44:57 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2011-02-01 16:44:57 (GMT) |
commit | a38070d20775a1b2522cddf2b39748ce6c96ba40 (patch) | |
tree | 7ecd4b3b11402e5890e5eb0d9b752b48400b05d0 /TurtleArt | |
parent | 51dd61088c6406ce50ecfe03baa6165ee54e4ade (diff) | |
parent | ab3ece2632fdd6fc3b5491ac7e9169d21f5f940d (diff) |
Merge git://git.collabora.co.uk/git/user/rgs/turtleart/
Diffstat (limited to 'TurtleArt')
-rw-r--r-- | TurtleArt/tacanvas.py | 8 | ||||
-rw-r--r-- | TurtleArt/tacollaboration.py (renamed from TurtleArt/collaboration.py) | 20 |
2 files changed, 18 insertions, 10 deletions
diff --git a/TurtleArt/tacanvas.py b/TurtleArt/tacanvas.py index 45c389c..d4395a2 100644 --- a/TurtleArt/tacanvas.py +++ b/TurtleArt/tacanvas.py @@ -657,9 +657,5 @@ class TurtleGraphics: return if self.tw.sharing(): - if self.tw.activity: - print "Sending: %s" % entry - self.tw.activity.send_event(entry) - elif self.tw.send_event: - print "Sending: %s" % entry - self.tw.send_event(entry) + print "Sending: %s" % entry + self.tw.send_event(entry) diff --git a/TurtleArt/collaboration.py b/TurtleArt/tacollaboration.py index b76b3c1..3c35e66 100644 --- a/TurtleArt/collaboration.py +++ b/TurtleArt/tacollaboration.py @@ -3,9 +3,16 @@ from dbus.service import signal from dbus.gobject_service import ExportedGObject import logging import telepathy -from sugar import profile -from sugar.presence import presenceservice -from sugar.presence.tubeconn import TubeConnection +from TurtleArt.tautils import data_to_string, data_from_string + +try: + from sugar import profile + from sugar.presence import presenceservice + from sugar.presence.tubeconn import TubeConnection +except: + profile = None + from collaboration import presenceservice + from collaboration.tubeconn import TubeConnection SERVICE = 'org.laptop.TurtleArtActivity' IFACE = SERVICE @@ -16,6 +23,7 @@ class Collaboration(): def __init__(self, tw, activity): """ A simplistic sharing model: the sharer is the master """ self._tw = tw + self._tw.send_event = self.send_event self._activity = activity def setup(self): @@ -225,7 +233,11 @@ class Collaboration(): return self._tw.nick def _get_colors(self): - return profile.get_color().to_string() + if profile: + colors = profile.get_color().to_string() + else: + colors = self._activity.get_colors() + return colors class ChatTube(ExportedGObject): |