示例#1
0
 def on_preferences_selected(self):
     '''called when the preference button is selected'''
     instance = extension.get_and_instantiate('preferences', self.session)
     if self.session is not instance.session:
         extension.delete_instance('preferences')
         instance = extension.get_and_instantiate('preferences', self.session)
     instance.show()
     instance.present()
示例#2
0
 def on_preferences_selected(self):
     '''called when the preference button is selected'''
     instance = extension.get_and_instantiate('preferences', self.session)
     if self.session is not instance.session:
         extension.delete_instance('preferences')
         instance = extension.get_and_instantiate('preferences', self.session)
     instance.show()
     instance.present()
示例#3
0
 def on_preferences_selected(self):
     """called when the preference button is selected"""
     instance = extension.get_and_instantiate("preferences", self.session)
     if self.session is not instance.session:
         extension.delete_instance("preferences")
         instance = extension.get_and_instantiate("preferences", self.session)
     instance.show()
     instance.present()
    def stop(self):
        '''stop the plugin'''
        self.session = None
        self.running = False

        extension.delete_instance(CATEGORY)

        return True
    def stop(self):
        '''stop the plugin'''
        self.session = None
        self.running = False

        extension.delete_instance(CATEGORY)

        return True
    def stop(self):
        '''stop the plugin'''
        self.session = None
        extension.delete_instance(CATEGORY)

        #FIXME: remove the first check once we depend on 2.12.5 and the second in 2.12.10+
        if hasattr(extension, 'unregister') and not hasattr(PluginBase, 'extension_unregister'):
            self.extensions_unregister()
        return True
示例#7
0
    def stop(self):
        """stop the plugin"""
        self.session = None
        extension.delete_instance(CATEGORY)
        if hasattr(extension, "unregister"):
            extension.unregister("userpanel button", MusicButton.MusicButton)
            self.extensions_unregister()

        return True
    def __init__(self, session):
        """constructor"""
        self.session = session
        self.instance = extension.get_and_instantiate('preferences', self.session)

        if self.session is not self.instance.session:
            extension.delete_instance('preferences')
            self.instance = extension.get_and_instantiate('preferences', self.session)

        self.page = DownloadExtension(self.session)
示例#9
0
    def on_preferences_selected(self):
        """called when the preference button is selected"""
        self.preferences = extension.get_and_instantiate("preferences", self.session)

        if self.session is not self.preferences.session:
            self.preferences.remove_subscriptions()
            extension.delete_instance("preferences")
            self.preferences = extension.get_and_instantiate("preferences", self.session)

        self.preferences.show()
        self.preferences.present()
示例#10
0
    def on_preferences_selected(self):
        '''called when the preference button is selected'''
        self.preferences = extension.get_and_instantiate(
            'preferences', self.session)

        if self.session is not self.preferences.session:
            self.preferences.remove_subscriptions()
            extension.delete_instance('preferences')
            self.preferences = extension.get_and_instantiate(
                'preferences', self.session)

        self.preferences.show()
        self.preferences.present()
示例#11
0
    def check_for_updates(self):
        '''Search for any updates'''
        if not self.session.config.get_or_set('b_check_for_updates', True):
            return

        updates_time = datetime.date.fromtimestamp(
                        self.config.get_or_set('f_check_updates_time', 0))
        now = datetime.date.today()
        delta = datetime.timedelta(weeks=1)
        if now - updates_time < delta:
            return

        self.config.f_check_updates_time = time.time()
        preferences = extension.get_and_instantiate('preferences',
                                                    self.session)
        if self.session is not preferences.session:
            extension.delete_instance('preferences')
            preferences = extension.get_and_instantiate('preferences',
                                                        self.session)

        preferences.check_for_updates()
示例#12
0
    def check_for_updates(self):
        '''Search for any updates'''
        if not self.session.config.get_or_set('b_check_for_updates', True):
            return

        updates_time = datetime.date.fromtimestamp(
            self.config.get_or_set('f_check_updates_time', 0))
        now = datetime.date.today()
        delta = datetime.timedelta(weeks=1)
        if now - updates_time < delta:
            return

        self.config.f_check_updates_time = time.time()
        preferences = extension.get_and_instantiate('preferences',
                                                    self.session)
        if self.session is not preferences.session:
            extension.delete_instance('preferences')
            preferences = extension.get_and_instantiate(
                'preferences', self.session)

        preferences.check_for_updates()