• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python widgetutil.get_feed_info函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中miro.frontends.widgets.widgetutil.get_feed_info函数的典型用法代码示例。如果您正苦于以下问题:Python get_feed_info函数的具体用法?Python get_feed_info怎么用?Python get_feed_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: get_image_path

 def get_image_path(self):
     if self.feed_mode:
         feed_info = widgetutil.get_feed_info(self.info.feed_id)
         return feed_info.thumbnail
     else:
         # use placeholder image until the metadata changes happen
         return resources.path('images/album-art-placeholder.gif')
开发者ID:codito,项目名称:miro,代码行数:7,代码来源:style.py


示例2: get_image_path

 def get_image_path(self, item_info, first_info):
     try:
         feed_info = widgetutil.get_feed_info(item_info.feed_id)
     except KeyError:
         return first_info.thumbnail
     else:
         return feed_info.thumbnail
开发者ID:bluezone,项目名称:miro,代码行数:7,代码来源:style.py


示例3: build_widget

    def build_widget(self):
        feed_info = widgetutil.get_feed_info(self.id)
        icon = imagepool.get(feed_info.thumbnail, size=(41, 41))
        self._make_item_views()

        add_icon_box = not self.is_folder and not feed_info.thumbnail.startswith(resources.root())
        if feed_info.is_directory_feed:
            self.titlebar = itemlistwidgets.ItemListTitlebar(feed_info.name, icon,
                    add_icon_box=add_icon_box)
        else:
            self.titlebar = itemlistwidgets.ChannelTitlebar(feed_info.name, icon,
                    add_icon_box=add_icon_box)
            self.titlebar.connect('save-search', self._on_save_search)
        self.titlebar.connect('search-changed', self._on_search_changed)
        self.widget.titlebar_vbox.pack_start(self.titlebar)
        if not self.is_folder:
            sep = separator.HSeparator((0.85, 0.85, 0.85), (0.95, 0.95, 0.95))
            self.widget.titlebar_vbox.pack_start(sep)
            self.widget.titlebar_vbox.pack_start(self._make_toolbar(feed_info))

        vbox = widgetset.VBox()
        vbox.pack_start(self.downloading_section)
        vbox.pack_start(self.full_section)
        vbox.pack_start(self.downloaded_section)

        background = widgetset.SolidBackground((1, 1, 1))
        background.add(vbox)

        scroller = widgetset.Scroller(False, True)
        scroller.add(background)

        self.widget.normal_view_vbox.pack_start(scroller, expand=True)
开发者ID:nxmirrors,项目名称:miro,代码行数:32,代码来源:feedcontroller.py


示例4: make_titlebar

 def make_titlebar(self):
     feed_info = widgetutil.get_feed_info(self.id)
     if feed_info.is_directory_feed:
         titlebar = itemlistwidgets.WatchedFolderTitlebar()
     elif feed_info.is_folder:
         titlebar = itemlistwidgets.ChannelFolderTitlebar()
     else:
         titlebar = itemlistwidgets.ChannelTitlebar()
         titlebar.connect('save-search', self._on_save_search)
     if not self.is_directory_feed:
         titlebar.hide_album_view_button()
     return titlebar
开发者ID:CodeforEvolution,项目名称:miro,代码行数:12,代码来源:feedcontroller.py


示例5: build_widget

    def build_widget(self):
        feed_info = widgetutil.get_feed_info(self.id)

        self.titlebar = self.make_titlebar(feed_info)
        self.titlebar.connect("filter-clicked", self.on_filter_clicked)
        self.titlebar.switch_to_view(self.widget.selected_view)
        self.titlebar.connect("search-changed", self._on_search_changed)
        self.widget.titlebar_vbox.pack_start(self.titlebar)
        if not self.is_folder and not self.is_directory_feed:
            self.widget.statusbar_vbox.pack_start(self._make_toolbar(feed_info))

        # this only gets shown when the user is searching for things
        # in the feed and there are no results.
        text = _("No Results")
        self.widget.list_empty_mode_vbox.pack_start(itemlistwidgets.EmptyListHeader(text))
开发者ID:nerdymcgee,项目名称:miro,代码行数:15,代码来源:feedcontroller.py


示例6: _update_counts

 def _update_counts(self):
     # FIXME: either find out a UI for these counts or delete them.
     return
     downloads = self.downloading_view.item_list.get_count()
     watchable = self.downloaded_view.item_list.get_count()
     full_count = self.full_view.item_list.get_count() + self._show_more_count
     info = widgetutil.get_feed_info(self.id)
     if info.autodownload_mode == "off" or info.unwatched < info.max_new:
         # don't count videos queued for other reasons
         autoqueued_count = 0
     else:
         autoqueued_count = len([i for i in self.full_view.item_list.get_items() if i.pending_auto_dl])
     self._update_downloading_section(downloads)
     self._update_downloaded_section(watchable)
     self._update_full_section(downloads, full_count, autoqueued_count)
开发者ID:nerdymcgee,项目名称:miro,代码行数:15,代码来源:feedcontroller.py


示例7: setup

 def setup(self, item_info, renderer, video_window):
     from miro.frontends.widgets import widgetutil
     self.item_info = item_info
     self.renderer = renderer
     self.titleLabel.setStringValue_(item_info.name)
     try:
         self.feedLabel.setStringValue_(widgetutil.get_feed_info(item_info.feed_id).name)
     except:
         self.feedLabel.setStringValue_("")
     self.keepButton.setEnabled_(item_info.can_be_saved)
     self.shareButton.setEnabled_(item_info.has_sharable_url)
     self.adjustContent(video_window, False)
     self.update_(nil)
     if NSApplication.sharedApplication().isActive() and video_window.isVisible():
         self.suspendAutoHiding()
         self.reveal(video_window)
开发者ID:nxmirrors,项目名称:miro,代码行数:16,代码来源:overlay.py


示例8: _expand_lists_initially

 def _expand_lists_initially(self):
     item_downloaded = self.downloaded_view.item_list.get_count() > 0
     feed_info = widgetutil.get_feed_info(self.id)
     autodownload_mode = feed_info.autodownload_mode
     self.downloaded_section.expand()
     self.full_section.show()
     all_items = self.full_view.item_list.get_items()
     viewed_items = [item for item in all_items \
             if item.downloaded or item.item_viewed]
     if not (item_downloaded and len(all_items) == len(viewed_items)):
         self.full_section.expand()
     if item_downloaded and 0 < len(viewed_items) < len(all_items):
         text = ngettext('Show %(count)d More Item',
                         'Show %(count)d More Items',
                         len(viewed_items),
                         {"count": len(viewed_items)})
         self.show_more_button.set_text(text + u" >>")
         self.show_more_button.set_size(widgetconst.SIZE_SMALL)
         self.show_more_container.show()
         self.full_view.item_list.set_new_only(True)
         self.full_view.model_changed()
         self._show_more_count = len(viewed_items)
     else:
         self._show_more_count = 0
开发者ID:nxmirrors,项目名称:miro,代码行数:24,代码来源:feedcontroller.py


示例9: build_renderer

 def build_renderer(self):
     feed_info = widgetutil.get_feed_info(self.id)
     return itemrenderer.ItemRenderer(display_channel=self.is_folder,
             is_podcast=(not feed_info.is_directory_feed))
开发者ID:CodeforEvolution,项目名称:miro,代码行数:4,代码来源:feedcontroller.py


示例10: _on_show_settings

 def _on_show_settings(self, widget):
     info = widgetutil.get_feed_info(self.id)
     feedsettingspanel.run_dialog(info)
开发者ID:CodeforEvolution,项目名称:miro,代码行数:3,代码来源:feedcontroller.py


示例11: _on_remove_feed

 def _on_remove_feed(self, widget):
     info = widgetutil.get_feed_info(self.id)
     app.widgetapp.remove_feeds([info])
开发者ID:CodeforEvolution,项目名称:miro,代码行数:3,代码来源:feedcontroller.py


示例12: _on_save_search

 def _on_save_search(self, widget, search_text):
     info = widgetutil.get_feed_info(self.id)
     messages.NewFeedSearchFeed(info, search_text).send_to_backend()
开发者ID:CodeforEvolution,项目名称:miro,代码行数:3,代码来源:feedcontroller.py


示例13: on_hotspot_clicked

    def on_hotspot_clicked(self, itemview, name, iter_):
        """Hotspot handler for ItemViews."""

        item_info, attrs = itemview.model[iter_]
        if name == 'download':
            if item_info.remote:
                name = 'download-sharing-item'
            elif item_info.device:
                name = 'download-device-item'
        if name in ('download', 'thumbnail-download'):
            messages.StartDownload(item_info.id).send_to_backend()
        elif name == 'pause':
            messages.PauseDownload(item_info.id).send_to_backend()
        elif name == 'resume':
            messages.ResumeDownload(item_info.id).send_to_backend()
        elif name == 'cancel':
            messages.CancelDownload(item_info.id).send_to_backend()
        elif name == 'keep':
            messages.KeepVideo(item_info.id).send_to_backend()
            app.saved_items.add(item_info.id)
        elif name == 'stop_seeding':
            messages.StopUpload(item_info.id).send_to_backend()
        elif name == 'start_seeding':
            messages.StartUpload(item_info.id).send_to_backend()
        elif name == 'delete':
            app.widgetapp.remove_items(selection=[item_info])
        elif name == 'remove':
            messages.RemoveVideosFromPlaylist(
                itemview.playlist_id, [item_info.id]).send_to_backend()
        elif name == 'visit_webpage':
            app.widgetapp.open_url(item_info.permalink)
        elif name == 'visit_comments':
            app.widgetapp.open_url(item_info.commentslink)
        elif name == 'visit_filelink':
            app.widgetapp.open_url(item_info.file_url)
        elif name == 'visit_license':
            app.widgetapp.open_url(item_info.license)
        elif name == 'show_local_file':
            app.widgetapp.check_then_reveal_file(item_info.video_path)
        elif name == 'show_contents':
            app.display_manager.push_folder_contents_display(item_info)
        elif name == 'cancel_auto_download':
            messages.CancelAutoDownload(item_info.id).send_to_backend()
        elif name.startswith('description-link:'):
            url = name.split(':', 1)[1]
            try:
                base_href = widgetutil.get_feed_info(
                    item_info.feed_id).base_href
            except KeyError:
                logging.warn("Feed not present when clicking link (%s)",
                        item_info.feed_id)
                # Feed is not around anymore for some reason (#13310).
                # Try without base_href
            else:
                url = urljoin(base_href, url)
            if subscription.is_subscribe_link(url):
                messages.SubscriptionLinkClicked(url).send_to_backend()
            else:
                app.widgetapp.open_url(url)
        elif name in ('play', 'thumbnail-play'):
            self._play_item_list(item_info.id)
        elif name == 'play_pause':
            if app.playback_manager.is_playing_item(item_info):
                app.playback_manager.toggle_paused()
            else:
                self._play_item_list(item_info.id)
        elif name.startswith('rate:'):
            rating = int(name.split(':', 1)[1])
            messages.RateItem(item_info, rating).send_to_backend()
        elif name == 'download-device-item':
            messages.DownloadDeviceItems([item_info]).send_to_backend()
        elif name == 'download-sharing-item':
            messages.DownloadSharingItems([item_info]).send_to_backend()
        else:
            logging.debug("ItemView doesn't know how to handle hotspot %s.",
                name)
开发者ID:kmshi,项目名称:miro,代码行数:76,代码来源:itemlistcontroller.py


示例14: on_hotspot_clicked

    def on_hotspot_clicked(self, itemview, name, iter):
        """Hotspot handler for ItemViews."""

        item_info = itemview.model[iter][0]
        show_details = itemview.model[iter][1]
        if name in ('download', 'thumbnail-download'):
            messages.StartDownload(item_info.id).send_to_backend()
        elif name == 'pause':
            messages.PauseDownload(item_info.id).send_to_backend()
        elif name == 'resume':
            messages.ResumeDownload(item_info.id).send_to_backend()
        elif name == 'cancel':
            messages.CancelDownload(item_info.id).send_to_backend()
        elif name == 'keep':
            messages.KeepVideo(item_info.id).send_to_backend()
        elif name == 'stop_seeding':
            messages.StopUpload(item_info.id).send_to_backend()
        elif name == 'start_seeding':
            messages.StartUpload(item_info.id).send_to_backend()
        elif name == 'delete':
            app.widgetapp.remove_items(selection=[item_info])
        elif name == 'remove':
            messages.RemoveVideosFromPlaylist(
                itemview.playlist_id, [item_info.id]).send_to_backend()
        elif name == 'details_toggle':
            itemview.model.update_value(iter, 1, not show_details)
            itemview.model_changed()
            itemview.invalidate_size_request()
        elif name == 'visit_webpage':
            app.widgetapp.open_url(item_info.permalink)
        elif name == 'visit_comments':
            app.widgetapp.open_url(item_info.commentslink)
        elif name == 'visit_filelink':
            app.widgetapp.open_url(item_info.file_url)
        elif name == 'visit_license':
            app.widgetapp.open_url(item_info.license)
        elif name == 'show_local_file':
            app.widgetapp.check_then_reveal_file(item_info.video_path)
        elif name == 'show_contents':
            app.display_manager.push_folder_contents_display(item_info)
        elif name == 'cancel_auto_download':
            messages.CancelAutoDownload(item_info.id).send_to_backend()
        elif name.startswith('description-link:'):
            url = name.split(':', 1)[1]
            try:
                base_href = widgetutil.get_feed_info(item_info.feed_id).base_href
            except ValueError:
                logging.warn("Feed not present when clicking link (%s)",
                        item_info.feed_id)
                # Feed is not around anymore for some reason (#13310).
                # Ignore the click.
                return
            if subscription.is_subscribe_link(url):
                messages.SubscriptionLinkClicked(url).send_to_backend()
            else:
                app.widgetapp.open_url(urljoin(base_href, url))
        elif name in ('play', 'thumbnail-play'):
            id = item_info.id
            items = itemview.item_list.get_items(start_id=id)
            self._play_item_list(items)
        elif name == 'play_pause':
            app.playback_manager.play_pause()
        elif name.startswith('rate:'):
            rating = int(name.split(':', 1)[1])
            messages.RateItem(item_info.id, rating).send_to_backend()
        else:
            logging.debug("ItemView doesn't know how to handle hotspot %s.",
                name)
开发者ID:nxmirrors,项目名称:miro,代码行数:68,代码来源:itemlistcontroller.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python widgetutil.make_surface函数代码示例发布时间:2022-05-27
下一篇:
Python widgetutil.align_middle函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap