Example #1
0
        def download_thread_func():
            if url.startswith('youtube://'):
                importer = youtube.find_youtube_channels(\
                        url[len('youtube://'):])
            else:
                importer = opml.Importer(url)

            if importer.items:
                model = OpmlListModel(importer)
            else:
                model = None

            def download_thread_finished():
                self._is_updating = False
                self.treeview.queue_draw()
                hildon.hildon_gtk_window_set_progress_indicator(\
                        self.main_window, False)
                self.action_select_all.set_property('visible', \
                        model is not None)
                self.action_select_none.set_property('visible', \
                        model is not None)
                self.treeview.set_model(model)
                self.set_subscribe_button_sensitive()

                if model is None:
                    self.show_message(_('No podcasts found. Try another source.'), \
                            important=True)
                    self.main_window.destroy()

            util.idle_add(download_thread_finished)
        def download_thread_func():
            if url.startswith('youtube://'):
                importer = youtube.find_youtube_channels(\
                        url[len('youtube://'):])
            else:
                importer = opml.Importer(url)

            if importer.items:
                model = OpmlListModel(importer)
            else:
                model = None
            def download_thread_finished():
                self._is_updating = False
                self.treeview.queue_draw()
                hildon.hildon_gtk_window_set_progress_indicator(\
                        self.main_window, False)
                self.action_select_all.set_property('visible', \
                        model is not None)
                self.action_select_none.set_property('visible', \
                        model is not None)
                self.treeview.set_model(model)
                self.set_subscribe_button_sensitive()

                if model is None:
                    self.show_message(_('No podcasts found. Try another source.'), \
                            important=True)
                    self.main_window.destroy()

            util.idle_add(download_thread_finished)
Example #3
0
    def thread_func(self, tab=0):
        if tab == 1:
            model = OpmlListModel(opml.Importer(my.TOPLIST_OPML))
            if len(model) == 0:
                self.notification(
                    _('The specified URL does not provide any valid OPML podcast items.'
                      ), _('No feeds found'))
        elif tab == 2:
            model = OpmlListModel(
                youtube.find_youtube_channels(
                    self.entryYoutubeSearch.get_text()))
            if len(model) == 0:
                self.notification(
                    _('There are no YouTube channels that would match this query.'
                      ), _('No channels found'))
        else:
            url = self.entryURL.get_text()
            if self.is_search_term(url):
                url = 'http://gpodder.net/search.opml?q=' + urllib.quote(url)
            model = OpmlListModel(opml.Importer(url))
            if len(model) == 0:
                self.notification(
                    _('The specified URL does not provide any valid OPML podcast items.'
                      ), _('No feeds found'))

        util.idle_add(self.thread_finished, model, tab)
    def thread_func(self, tab=0):
        if tab == 1:
            model = OpmlListModel(opml.Importer(self._config.toplist_url))
            if len(model) == 0:
                self.notification(_('The specified URL does not provide any valid OPML podcast items.'), _('No feeds found'))
        elif tab == 2:
            model = OpmlListModel(youtube.find_youtube_channels(self.entryYoutubeSearch.get_text()))
            if len(model) == 0:
                self.notification(_('There are no YouTube channels that would match this query.'), _('No channels found'))
        else:
            url = self.entryURL.get_text()
            model = OpmlListModel(opml.Importer(url))
            if len(model) == 0:
                self.notification(_('The specified URL does not provide any valid OPML podcast items.'), _('No feeds found'))

        util.idle_add(self.thread_finished, model, tab)
Example #5
0
    def thread_func(self, tab=0):
        if tab == 1:
            model = OpmlListModel(opml.Importer(my.TOPLIST_OPML))
            if len(model) == 0:
                self.notification(_('The specified URL does not provide any valid OPML podcast items.'), _('No feeds found'))
        elif tab == 2:
            model = OpmlListModel(youtube.find_youtube_channels(self.entryYoutubeSearch.get_text()))
            if len(model) == 0:
                self.notification(_('There are no YouTube channels that would match this query.'), _('No channels found'))
        else:
            url = self.entryURL.get_text()
            if self.is_search_term(url):
                url = 'http://gpodder.net/search.opml?q=' + urllib.quote(url)
            model = OpmlListModel(opml.Importer(url))
            if len(model) == 0:
                self.notification(_('The specified URL does not provide any valid OPML podcast items.'), _('No feeds found'))

        util.idle_add(self.thread_finished, model, tab)
Example #6
0
        def download_thread_func():
            if use_youtube:
                importer = youtube.find_youtube_channels(url)
            else:
                importer = opml.Importer(url)

            if importer.items:
                model = OpmlListModel(importer)
            else:
                model = None
                self.show_message(_('Please pick another source.'), _('No podcasts found'))

            def download_thread_finished():
                if banner is not None:
                    banner.destroy()
                self.treeview.set_model(model)
                self.treeview.set_sensitive(True)
                self.button_cancel.set_sensitive(True)
                self.set_subscribe_button_sensitive()
            util.idle_add(download_thread_finished)
Example #7
0
        def download_thread_func():
            if use_youtube:
                importer = youtube.find_youtube_channels(url)
            else:
                importer = opml.Importer(url)

            if importer.items:
                model = OpmlListModel(importer)
            else:
                model = None
                self.show_message(_('Please pick another source.'),
                                  _('No podcasts found'))

            def download_thread_finished():
                if banner is not None:
                    banner.destroy()
                self.treeview.set_model(model)
                self.treeview.set_sensitive(True)
                self.button_cancel.set_sensitive(True)
                self.set_subscribe_button_sensitive()

            util.idle_add(download_thread_finished)
Example #8
0
    def thread_func(self, tab=0):
        if tab == 1:
            model = OpmlListModel(opml.Importer(self._config.toplist_opml))
            if len(model) == 0:
                self.notification(
                    _("The specified URL does not provide any valid OPML podcast items."), _("No feeds found")
                )
        elif tab == 2:
            model = OpmlListModel(youtube.find_youtube_channels(self.entryYoutubeSearch.get_text()))
            if len(model) == 0:
                self.notification(
                    _("There are no YouTube channels that would match this query."), _("No channels found")
                )
        else:
            url = self.entryURL.get_text()
            if "://" not in url and not os.path.exists(url):
                url = "http://gpodder.net/search.opml?q=" + urllib.quote(url)
            model = OpmlListModel(opml.Importer(url))
            if len(model) == 0:
                self.notification(
                    _("The specified URL does not provide any valid OPML podcast items."), _("No feeds found")
                )

        util.idle_add(self.thread_finished, model, tab)
Example #9
0
    def thread_func(self, tab, param=None):
        if tab == TabType.ChannelChooser:
            url = param
            if url is None:
                url = self.getInitialOMPLUrl()

            if self.is_search_term(url):
                url = 'http://gpodder.net/search.opml?q=' + urllib.quote(url)

            model = OpmlListModel(opml.Importer(url))

            if model.rowCount() == 0:
                self.notification(
                    _('The specified URL does not provide any valid OPML podcast items.'),
                    _('No feeds found')
                )

        elif tab == TabType.TopPodcasts:
            model = OpmlListModel(opml.Importer(my.TOPLIST_OPML))

            if model.rowCount() == 0:
                self.notification(
                    _('The specified URL does not provide any valid OPML podcast items.'),
                    _('No feeds found')
                )

        elif tab == TabType.Youtube:
            model = OpmlListModel(youtube.find_youtube_channels(param))

            if model.rowCount() == 0:
                self.notification(
                    _('There are no YouTube channels that would match this query.'),
                    _('No channels found')
                )

        self.setModel(tab, model)