本文整理匯總了Python中Playlist.Playlist.xml_to_dict方法的典型用法代碼示例。如果您正苦於以下問題:Python Playlist.xml_to_dict方法的具體用法?Python Playlist.xml_to_dict怎麽用?Python Playlist.xml_to_dict使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Playlist.Playlist
的用法示例。
在下文中一共展示了Playlist.xml_to_dict方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: SystemTray
# 需要導入模塊: from Playlist import Playlist [as 別名]
# 或者: from Playlist.Playlist import xml_to_dict [as 別名]
#.........這裏部分代碼省略.........
self.tray_icon.setIcon(QtGui.QIcon(":/images/icon.png"))
self.tray_icon.setContextMenu(self.tray_menu)
self.tray_icon.show()
def hide_all(self):
"""
Hide UI.
"""
self.hide_ui()
self.central_widget.hide()
def show_all(self):
""""
Show UI for 10 seconds, then hide it.
"""
print "show"
self.show_ui()
self.central_widget.show()
self.timer_show.start(10000) # 10 seconds, display UI time in ms
self.timer_show.timeout.connect(self.hide_all)
def set_meta_data(self):
"""
Set xml meta data and show message. Check if images are available to download.
:return: None
"""
info_1 = self.media.get_meta(vlc.Meta.NowPlaying) # get xml data
if info_1 != self.info_0:
self.info_0 = info_1
# print "now playing: {0}".format(self.info_0)
self.playlist.set_info(self.playlist.xml_to_dict(self.info_0))
self.playlist.show_msg()
self.my_dict = self.playlist.xml_to_dict(self.info_0)
# print "my_dict: ", self.my_dict
if self.player.is_playing():
try:
if self.my_dict["album_cover"]:
self.save_cover_action.setVisible(True)
else:
self.save_cover_action.setVisible(False)
except TypeError: # parse data delay when play button pressed
pass
try:
if self.my_dict["program_image"]:
self.save_image_action.setVisible(True)
else:
self.save_image_action.setVisible(False)
except TypeError: # parse data delay when play button pressed
pass
def play_pause(self):
"""
Play or pause radio stream.
:return: None
"""
if self.player.is_playing():
# print "paused"
self.timer_show.killTimer(10)
self.timer_check.stop()