本文整理汇总了Python中system.mbus.Bus.pub方法的典型用法代码示例。如果您正苦于以下问题:Python Bus.pub方法的具体用法?Python Bus.pub怎么用?Python Bus.pub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类system.mbus.Bus
的用法示例。
在下文中一共展示了Bus.pub方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_drop_received
# 需要导入模块: from system.mbus import Bus [as 别名]
# 或者: from system.mbus.Bus import pub [as 别名]
def on_drop_received(self, source, target, data):
Bus.pub(self.BUSNAME, "playlist_changed", source)
print "on_drop_received: sl: %s, target: %s, data: %s" % (source.props.name, target, data)
示例2: on_playlist_added
# 需要导入模块: from system.mbus import Bus [as 别名]
# 或者: from system.mbus.Bus import pub [as 别名]
def on_playlist_added(self, manager, source):
Bus.pub(self.BUSNAME, "playlist_added", source)
self.sourcescb.append(source.connect("status-changed", self.on_status_changed))
print "playlist-added: %s" % source.props.name
示例3: on_playlist_created
# 需要导入模块: from system.mbus import Bus [as 别名]
# 或者: from system.mbus.Bus import pub [as 别名]
def on_playlist_created(self, manager, source):
Bus.pub(self.BUSNAME, "playlist_created", source)
print "playlist-created: %s" % source.props.name
示例4: on_status_changed
# 需要导入模块: from system.mbus import Bus [as 别名]
# 或者: from system.mbus.Bus import pub [as 别名]
def on_status_changed(self, source):
if self.active:
Bus.pub(self.BUSNAME, "playlist_changed", self.shell, self.db, source)
print "status-changed: %s" % source.props.name