def run_select_rssfeed(self, subscription_config=None, callback_func=None):
        config = self.get_test_config()

        if not subscription_config:
            subscription_config = yarss_config.get_fresh_subscription_config()
        subscription_dialog = DialogSubscription(
            None,  # GTKUI
            self.log,  # logger
            subscription_config,
            config["rssfeeds"],
            [],  #self.get_move_completed_list(),
            [],  #self.get_download_location_list(),
            {},  #self.email_messages,
            {})  #self.cookies)
        subscription_dialog.setup()

        def pass_func(*arg):
            pass

        # Override the default selection callback
        subscription_dialog.method_perform_rssfeed_selection = pass_func

        # Sets the index 0 of rssfeed combox activated.
        rssfeeds_combobox = subscription_dialog.glade.get_widget(
            "combobox_rssfeeds")
        rssfeeds_combobox.set_active(1)

        defered = subscription_dialog.perform_rssfeed_selection()
        defered.addCallback(callback_func, subscription_dialog)
        return defered
    def run_select_rssfeed(self, subscription_config=None, callback_func=None):
        config = self.get_test_config()

        if not subscription_config:
            subscription_config = yarss_config.get_fresh_subscription_config()
        subscription_dialog = DialogSubscription(None, # GTKUI
                                                 self.log, # logger
                                                 subscription_config,
                                                 config["rssfeeds"],
                                                 [], #self.get_move_completed_list(),
                                                 [], #self.get_download_location_list(),
                                                 {}, #self.email_messages,
                                                 {}) #self.cookies)
        subscription_dialog.setup()

        def pass_func(*arg):
            #pass
            print "PASS FUNC"
            return defer.Deferred()

        class DialogWrapper(object):
            def __init__(self, dialog):
                self.dialog = dialog
            def get_visible(self):
                return True

        subscription_dialog.dialog = DialogWrapper(subscription_dialog.dialog)

        # Override the default selection callback
        #subscription_dialog.method_perform_rssfeed_selection = pass_func
        subscription_dialog.perform_rssfeed_selection = pass_func

        # Sets the index 0 of rssfeed combox activated.
        rssfeeds_combobox = subscription_dialog.glade.get_widget("combobox_rssfeeds")
        rssfeeds_combobox.set_active(1)

        #defered = subscription_dialog.perform_rssfeed_selection()
        defered = subscription_dialog.method_perform_rssfeed_selection()
        defered.addCallback(callback_func, subscription_dialog)
        return defered
Beispiel #3
0
    def run_select_rssfeed(self, subscription_config=None, callback_func=None):
        config = self.get_test_config()

        if not subscription_config:
            subscription_config = yarss_config.get_fresh_subscription_config()
        subscription_dialog = DialogSubscription(
            TestGTKUIBase(),  # GTKUI
            self.log,  # logger
            subscription_config,
            config["rssfeeds"],
            [],  # self.get_move_completed_list(),
            [],  # self.get_download_location_list(),
            {},  # self.email_messages,
            {})  # self.cookies)
        subscription_dialog.setup()

        def pass_func(*arg):
            return defer.succeed(None)

        class DialogWrapper(object):
            def __init__(self, dialog):
                self.dialog = dialog

            def get_visible(self):
                return True

        subscription_dialog.dialog = DialogWrapper(subscription_dialog.dialog)

        # Override the default selection callback
        subscription_dialog.method_perform_rssfeed_selection = pass_func

        # Sets the index 0 of rssfeed combox activated.
        rssfeeds_combobox = subscription_dialog.glade.get_widget(
            "combobox_rssfeeds")
        rssfeeds_combobox.set_active(0)

        deferred = subscription_dialog.perform_rssfeed_selection()
        deferred.addCallback(callback_func, subscription_dialog)
        return deferred