本文整理汇总了Python中sugar3.power.get_power_manager函数的典型用法代码示例。如果您正苦于以下问题:Python get_power_manager函数的具体用法?Python get_power_manager怎么用?Python get_power_manager使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_power_manager函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: stop_sound_device
def stop_sound_device(self):
if self._pipeline is None:
return
self._pipeline.set_state(Gst.State.NULL)
power.get_power_manager().restore_suspend()
self.emit('stop')
开发者ID:leonardcj,项目名称:words-activity,代码行数:7,代码来源:speech.py
示例2: pause_sound_device
def pause_sound_device(self):
if self._pipeline is None:
return
self._pipeline.set_state(Gst.State.PAUSED)
power.get_power_manager().restore_suspend()
self.emit('pause')
开发者ID:leonardcj,项目名称:words-activity,代码行数:7,代码来源:speech.py
示例3: restart_sound_device
def restart_sound_device(self):
if self._pipeline is None:
logging.debug('Trying to restart not initialized sound device')
return
power.get_power_manager().inhibit_suspend()
self._pipeline.set_state(Gst.State.PLAYING)
self.emit('play')
开发者ID:leonardcj,项目名称:words-activity,代码行数:8,代码来源:speech.py
示例4: _complete_close
def _complete_close(self):
self.destroy()
if self.shared_activity:
self.shared_activity.leave()
self._cleanup_jobject()
# Make the exported object inaccessible
dbus.service.Object.remove_from_connection(self._bus)
self._session.unregister(self)
power.get_power_manager().shutdown()
开发者ID:godiard,项目名称:sugar-toolkit-gtk3,代码行数:13,代码来源:activity.py
示例5: __joined_cb
def __joined_cb(self, activity, success, err):
"""Callback when join has finished"""
logging.debug('Activity.__joined_cb %r' % success)
self.shared_activity.disconnect(self._join_id)
self._join_id = None
if not success:
logging.debug('Failed to join activity: %s' % err)
return
power_manager = power.get_power_manager()
if power_manager.suspend_breaks_collaboration():
power_manager.inhibit_suspend()
self.reveal()
self.emit('joined')
self.__privacy_changed_cb(self.shared_activity, None)
开发者ID:godiard,项目名称:sugar-toolkit-gtk3,代码行数:16,代码来源:activity.py
示例6: __share_cb
def __share_cb(self, ps, success, activity, err):
if not success:
logging.debug('Share of activity %s failed: %s.' %
(self._activity_id, err))
return
logging.debug('Share of activity %s successful, PS activity is %r.' %
(self._activity_id, activity))
activity.props.name = self._jobject.metadata['title']
power_manager = power.get_power_manager()
if power_manager.suspend_breaks_collaboration():
power_manager.inhibit_suspend()
self.shared_activity = activity
self.shared_activity.connect('notify::private',
self.__privacy_changed_cb)
self.emit('shared')
self.__privacy_changed_cb(self.shared_activity, None)
self._send_invites()
开发者ID:godiard,项目名称:sugar-toolkit-gtk3,代码行数:22,代码来源:activity.py
示例7: __pipe_message_cb
def __pipe_message_cb(self, bus, message):
if message.type in (Gst.MessageType.EOS, Gst.MessageType.ERROR):
self._pipeline.set_state(Gst.State.NULL)
self._pipeline = None
power.get_power_manager().restore_suspend()
self.emit('stop')
开发者ID:leonardcj,项目名称:words-activity,代码行数:6,代码来源:speech.py
注:本文中的sugar3.power.get_power_manager函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论