Esempio n. 1
0
    def _message_cb(self, colab, buddy, msg):
        """
        Events are sent as action and payload.  Everyone gets the
        turtle dictionary from the sharer and watches for 't' events,
        which indicate that a new turtle has joined.
        """

        action = msg.get('action')

        if action in self._processing_methods:
            save_active_turtle = self._tw.turtles.get_active_turtle()
            self._processing_methods[action](msg.get('event'))
            self._tw.turtles.set_turtle(
                self._tw.turtles.get_turtle_key(save_active_turtle))
            return

        if action == '!!ACTION_INIT_REQUEST':
            return

        error_output('unhandled action %r' % action)
Esempio n. 2
0
 def _list_tubes_error_cb(self, e):
     error_output('ListTubes() failed: %s' % (e), self._tw.running_sugar)
 def _list_tubes_error_cb(self, e):
     error_output('ListTubes() failed: %s' % (e), self._tw.running_sugar)