本文整理匯總了Python中sugar3.bundle.activitybundle.ActivityBundle.get_max_participants方法的典型用法代碼示例。如果您正苦於以下問題:Python ActivityBundle.get_max_participants方法的具體用法?Python ActivityBundle.get_max_participants怎麽用?Python ActivityBundle.get_max_participants使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sugar3.bundle.activitybundle.ActivityBundle
的用法示例。
在下文中一共展示了ActivityBundle.get_max_participants方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _update_invite_menu
# 需要導入模塊: from sugar3.bundle.activitybundle import ActivityBundle [as 別名]
# 或者: from sugar3.bundle.activitybundle.ActivityBundle import get_max_participants [as 別名]
def _update_invite_menu(self, activity):
buddy_activity = self._buddy.props.current_activity
if buddy_activity is not None:
buddy_activity_id = buddy_activity.activity_id
else:
buddy_activity_id = None
self._invite_menu.hide()
if activity is None or \
activity.is_journal() or \
activity.get_activity_id() == buddy_activity_id:
return
bundle_activity = ActivityBundle(activity.get_bundle_path())
if bundle_activity.get_max_participants() > 1:
title = activity.get_title()
self._invite_menu.set_label(_('Invite to %s') % title)
icon = Icon(file=activity.get_icon_path(),
pixel_size=style.SMALL_ICON_SIZE)
icon.props.xo_color = activity.get_icon_color()
self._invite_menu.set_image(icon)
icon.show()
self._invite_menu.show()