[Sugar-devel] [write PATCH] sl#4436: Making collaboration work again.

Walter Bender walter.bender at gmail.com
Thu Feb 21 08:26:23 EST 2013


I've had to make a similar change in my activities as well. (I guess I
missed the patch go by when self._shared_activity became
self.shared_actvity)  There is a also a method,
self.get_shared_activity(), which might be better than directly
referencing the instance variable. I suppose it is a style issue.

-walter

On Thu, Feb 21, 2013 at 6:53 AM, Ajay Garg <ajay at activitycentral.com> wrote:
> This stopped working (for "Write"), since the time
> http://git.sugarlabs.org/sugar-toolkit-gtk3/sugar-toolkit-gtk3/commit/70cee44717d46129419992cd6a7e15472dc1f568
> was pushed.
>
> Signed-off-by: Ajay Garg <ajay at activitycentral.com>
> ---
>  AbiWordActivity.py     | 21 ++++++++++-----------
>  1 files changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/AbiWordActivity.py b/AbiWordActivity.py
> index 35b248c..e95718e 100644
> --- a/AbiWordActivity.py
> +++ b/AbiWordActivity.py
> @@ -67,7 +67,6 @@ class AbiWordActivity(activity.Activity):
>
>          # create our main abiword canvas
>          self.abiword_canvas = DocumentView()
> -        self._shared_activity = None
>          self._new_instance = True
>          toolbar_box = ToolbarBox()
>
> @@ -182,13 +181,13 @@ class AbiWordActivity(activity.Activity):
>
>          self.connect('shared', self._shared_cb)
>
> -        if self._shared_activity:
> +        if self.shared_activity:
>              # we are joining the activity
>              logger.error('We are joining an activity')
>              self.connect('joined', self._joined_cb)
> -            self._shared_activity.connect('buddy-joined',
> +            self.shared_activity.connect('buddy-joined',
>                      self._buddy_joined_cb)
> -            self._shared_activity.connect('buddy-left', self._buddy_left_cb)
> +            self.shared_activity.connect('buddy-left', self._buddy_left_cb)
>              if self.get_shared():
>  #                # oh, OK, we've already joined
>                  self._joined_cb()
> @@ -236,8 +235,8 @@ class AbiWordActivity(activity.Activity):
>          logger.error('My Write activity was shared')
>          self._sharing_setup()
>
> -        self._shared_activity.connect('buddy-joined', self._buddy_joined_cb)
> -        self._shared_activity.connect('buddy-left', self._buddy_left_cb)
> +        self.shared_activity.connect('buddy-joined', self._buddy_joined_cb)
> +        self.shared_activity.connect('buddy-left', self._buddy_left_cb)
>
>          channel = self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES]
>          logger.error('This is my activity: offering a tube...')
> @@ -247,13 +246,13 @@ class AbiWordActivity(activity.Activity):
>      def _sharing_setup(self):
>          logger.debug("_sharing_setup()")
>
> -        if self._shared_activity is None:
> +        if self.shared_activity is None:
>              logger.error('Failed to share or join activity')
>              return
>
> -        self.conn = self._shared_activity.telepathy_conn
> -        self.tubes_chan = self._shared_activity.telepathy_tubes_chan
> -        self.text_chan = self._shared_activity.telepathy_text_chan
> +        self.conn = self.shared_activity.telepathy_conn
> +        self.tubes_chan = self.shared_activity.telepathy_tubes_chan
> +        self.text_chan = self.shared_activity.telepathy_text_chan
>          self.tube_id = None
>          self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES].connect_to_signal(
>                  'NewTube', self._new_tube_cb)
> @@ -267,7 +266,7 @@ class AbiWordActivity(activity.Activity):
>
>      def _joined_cb(self, activity):
>          logger.error("_joined_cb()")
> -        if not self._shared_activity:
> +        if not self.shared_activity:
>              return
>
>          self.joined = True
> --
> 1.7.11.7
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel



-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org


More information about the Sugar-devel mailing list