本文整理汇总了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()
示例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()