當前位置: 首頁>>代碼示例>>Python>>正文


Python Playlist.xml_to_dict方法代碼示例

本文整理匯總了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()
開發者ID:19po,項目名稱:rtl102.5-playlist,代碼行數:70,代碼來源:SystemTray.py


注:本文中的Playlist.Playlist.xml_to_dict方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。