本文整理汇总了Python中TriblerGUI.tribler_request_manager.TriblerRequestManager.get_my_channel_rss_feeds方法的典型用法代码示例。如果您正苦于以下问题:Python TriblerRequestManager.get_my_channel_rss_feeds方法的具体用法?Python TriblerRequestManager.get_my_channel_rss_feeds怎么用?Python TriblerRequestManager.get_my_channel_rss_feeds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TriblerGUI.tribler_request_manager.TriblerRequestManager
的用法示例。
在下文中一共展示了TriblerRequestManager.get_my_channel_rss_feeds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MyChannelPage
# 需要导入模块: from TriblerGUI.tribler_request_manager import TriblerRequestManager [as 别名]
# 或者: from TriblerGUI.tribler_request_manager.TriblerRequestManager import get_my_channel_rss_feeds [as 别名]
class MyChannelPage(QWidget):
"""
This class is responsible for managing lists and data on the your channel page, including torrents, playlists
and rss feeds.
"""
def initialize_my_channel_page(self):
self.my_channel_stacked_widget = self.findChild(QStackedWidget, "my_channel_stacked_widget")
self.my_channel_details_stacked_widget = self.findChild(QStackedWidget, "my_channel_details_stacked_widget")
self.create_channel_form = self.findChild(QWidget, "create_channel_form")
self.create_new_channel_intro_label = self.findChild(QLabel, "create_new_channel_intro_label")
self.create_channel_intro_button = self.findChild(QPushButton, "create_channel_intro_button")
self.create_channel_intro_button.clicked.connect(self.on_create_channel_intro_button_clicked)
self.my_channel_name_label = self.findChild(QLabel, "my_channel_name_label")
self.my_channel_description_label = self.findChild(QLabel, "my_channel_description_label")
self.my_channel_identifier_label = self.findChild(QLabel, "my_channel_identifier_label")
self.my_channel_name_input = self.findChild(QLineEdit, "my_channel_name_input")
self.my_channel_description_input = self.findChild(QTextEdit, "my_channel_description_input")
self.my_channel_torrents_list = self.findChild(QTreeWidget, "my_channel_torrents_list")
self.my_channel_rss_feeds_list = self.findChild(QTreeWidget, "my_channel_rss_feeds_list")
self.create_channel_intro_button_container = self.findChild(QWidget, "create_channel_intro_button_container")
self.create_channel_form.hide()
self.my_channel_stacked_widget.setCurrentIndex(1)
self.my_channel_details_stacked_widget.setCurrentIndex(PAGE_MY_CHANNEL_OVERVIEW)
self.channel_settings_page = self.findChild(QWidget, "channel_settings_page")
self.my_channel_torrents_remove_selected_button = self.findChild(QToolButton,
"my_channel_torrents_remove_selected_button")
self.my_channel_torrents_remove_selected_button.clicked.connect(self.on_torrents_remove_selected_clicked)
self.my_channel_torrents_remove_all_button = self.findChild(QToolButton,
"my_channel_torrents_remove_all_button")
self.my_channel_torrents_remove_all_button.clicked.connect(self.on_torrents_remove_all_clicked)
self.my_channel_torrents_export_button = self.findChild(QToolButton, "my_channel_torrents_export_button")
self.my_channel_torrents_export_button.clicked.connect(self.on_torrents_export_clicked)
# Tab bar buttons
self.channel_settings_tab = self.findChild(QWidget, "channel_settings_tab")
self.channel_settings_tab.initialize()
self.channel_settings_tab.clicked_tab_button.connect(self.clicked_tab_button)
# add some dummy items to rss feeds list
for i in range(0, 10):
item = QTreeWidgetItem(self.my_channel_rss_feeds_list)
item.setText(0, "http://fancyurl.com/rss_feed.xml")
self.my_channel_rss_feeds_list.addTopLevelItem(item)
def load_my_channel_overview(self):
self.mychannel_request_mgr = TriblerRequestManager()
self.mychannel_request_mgr.get_my_channel_overview(self.initialize_with_overview)
def initialize_with_overview(self, overview):
self.my_channel_overview = overview
self.my_channel_name_label.setText(overview["name"])
self.my_channel_description_label.setText(overview["description"])
self.my_channel_identifier_label.setText(overview["identifier"])
self.my_channel_name_input.setText(overview["name"])
self.my_channel_description_input.setText(overview["description"])
def load_my_channel_torrents(self):
self.mychannel_request_mgr = TriblerRequestManager()
self.mychannel_request_mgr.get_my_channel_torrents(self.initialize_with_torrents)
def initialize_with_torrents(self, torrents):
self.my_channel_torrents_list.clear()
for torrent in torrents:
item = QTreeWidgetItem(self.my_channel_torrents_list)
item.setText(0, torrent["name"])
item.setText(1, str(torrent["added"]))
self.my_channel_torrents_list.addTopLevelItem(item)
def load_my_channel_rss_feeds(self):
self.mychannel_request_mgr = TriblerRequestManager()
self.mychannel_request_mgr.get_my_channel_rss_feeds(self.initialize_with_rss_feeds)
def initialize_with_rss_feeds(self, rss_feeds):
self.my_channel_rss_feeds_list.clear()
for feed in rss_feeds:
item = QTreeWidgetItem(self.my_channel_rss_feeds_list)
item.setText(0, feed["url"])
self.my_channel_rss_feeds_list.addTopLevelItem(item)
def on_torrents_remove_selected_clicked(self):
num_selected = len(self.my_channel_torrents_list.selectedItems())
if num_selected == 0:
return
self.dialog = ConfirmationDialog(self, "Remove %s selected torrents" % num_selected,
"Are you sure that you want to remove %s selected torrents from your channel?" % num_selected)
#.........这里部分代码省略.........