当前位置: 首页>>代码示例>>Python>>正文


Python Activity.join方法代码示例

本文整理汇总了Python中activity.Activity.join方法的典型用法代码示例。如果您正苦于以下问题:Python Activity.join方法的具体用法?Python Activity.join怎么用?Python Activity.join使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在activity.Activity的用法示例。


在下文中一共展示了Activity.join方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: activity_shared

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import join [as 别名]
                            self._get_preferred_plugin(), 0,
                            id=actid, type=atype,
                            name=name, color=self._owner.props.color,
                            local=True, private=True, tags=tags)

        activity.connect("validity-changed",
                         self._activity_validity_changed_cb)
        activity.connect("disappeared", self._activity_disappeared_cb)
        self._activities_by_id[actid] = activity

        def activity_shared():
            tp, room = activity.room_details
            self._activities_by_handle[tp][room] = activity
            async_cb(activity.object_path())

        activity.join(activity_shared, async_err_cb, sharing=True,
                      private=private, sender=sender)

        # local activities are valid at creation by definition, but we can't
        # connect to the activity's validity-changed signal until its already
        # issued the signal, which happens in the activity's constructor
        # for local activities.
        self._activity_validity_changed_cb(activity, activity.props.valid)

    def _activity_validity_changed_cb(self, activity, valid):
        if valid:
            self.ActivityAppeared(activity.object_path())
            _logger.debug("New Activity: %s (%s)", activity.props.name,
                          activity.props.id)
        else:
            self.ActivityDisappeared(activity.object_path())
            _logger.debug("Activity disappeared: %s (%s)",
开发者ID:tchx84,项目名称:debian-pkg-sugar-presence,代码行数:34,代码来源:presenceservice.py


注:本文中的activity.Activity.join方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。