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


Python Settings.getNotificationDisplayDuration方法代码示例

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


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

示例1: showPopup

# 需要导入模块: from resources.lib.settings import Settings [as 别名]
# 或者: from resources.lib.settings.Settings import getNotificationDisplayDuration [as 别名]
 def showPopup(self):
     self.show()
     xbmc.sleep(Settings.getNotificationDisplayDuration())
     self.close()
开发者ID:robwebset,项目名称:script.sonos,代码行数:6,代码来源:service.py

示例2: log

# 需要导入模块: from resources.lib.settings import Settings [as 别名]
# 或者: from resources.lib.settings.Settings import getNotificationDisplayDuration [as 别名]
                            # Check to see if the playing track has changed
                            if (track is not None) and ((lastDisplayedTrack is None) or (track['uri'] != lastDisplayedTrack['uri'])):
                                # Update the last displayed track to the current one
                                lastDisplayedTrack = track
                                # Only display the dialog if it is playing
                                if isActive:
                                    if Settings.useXbmcNotifDialog():
                                        log("SonosService: Currently playing artist = %s, album = %s, track = %s" % (track['artist'], track['album'], track['title']))

                                        # Get the album art if it is set (Default to the Sonos icon)
                                        albumArt = ICON
                                        if track['album_art'] != "":
                                            albumArt = track['album_art']

                                        # Gotham allows you to have a dialog without making a sound
                                        xbmcgui.Dialog().notification(track['artist'], track['title'], albumArt, Settings.getNotificationDisplayDuration(), False)
                                    else:
                                        sonosPopup = SonosPlayingPopup.createSonosPlayingPopup(track)
                                        sonosPopup.showPopup()
                                        del sonosPopup
                        except:
                            # Connection failure - may just be a network glitch - so don't exit
                            log("SonosService: Error from speaker %s" % Settings.getIPAddress())
                            log("SonosService: %s" % traceback.format_exc())

                        # No longer the first start
                        justStartedService = False

                    # Reset the timer for the next check
                    timeUntilNextCheck = Settings.getNotificationCheckFrequency() * Settings.getChecksPerSecond()
开发者ID:robwebset,项目名称:script.sonos,代码行数:32,代码来源:service.py


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