當前位置: 首頁>>代碼示例>>Python>>正文


Python plugin_updater.PluginUpdaterDialog類代碼示例

本文整理匯總了Python中calibre.gui2.dialogs.plugin_updater.PluginUpdaterDialog的典型用法代碼示例。如果您正苦於以下問題:Python PluginUpdaterDialog類的具體用法?Python PluginUpdaterDialog怎麽用?Python PluginUpdaterDialog使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了PluginUpdaterDialog類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_plugins

 def get_plugins(self):
     from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog,
             FILTER_NOT_INSTALLED)
     d = PluginUpdaterDialog(self.gui,
             initial_filter=FILTER_NOT_INSTALLED)
     d.exec_()
     if d.do_restart:
         self.gui.quit(restart=True)
開發者ID:JimmXinu,項目名稱:calibre,代碼行數:8,代碼來源:preferences.py

示例2: check_for_plugin_updates

    def check_for_plugin_updates(self):
        # Get the user to choose a plugin to install
        initial_filter = FILTER_UPDATE_AVAILABLE
        mods = QApplication.keyboardModifiers()
        if mods & Qt.ControlModifier or mods & Qt.ShiftModifier:
            initial_filter = FILTER_ALL

        d = PluginUpdaterDialog(self.gui, initial_filter=initial_filter)
        d.exec_()
開發者ID:Eksmo,項目名稱:calibre,代碼行數:9,代碼來源:plugin_updates.py

示例3: update_plugins

 def update_plugins(self, not_installed=False):
     from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog,
                             FILTER_UPDATE_AVAILABLE, FILTER_NOT_INSTALLED)
     mode = FILTER_NOT_INSTALLED if not_installed else FILTER_UPDATE_AVAILABLE
     d = PluginUpdaterDialog(self.gui, initial_filter=mode)
     d.exec_()
     self._plugin_model.populate()
     self._plugin_model.reset()
     self.changed_signal.emit()
開發者ID:Eksmo,項目名稱:calibre,代碼行數:9,代碼來源:plugins.py

示例4: get_plugins

 def get_plugins(self):
     from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog,
         FILTER_UPDATE_AVAILABLE)
     d = PluginUpdaterDialog(self.parent(),
             initial_filter=FILTER_UPDATE_AVAILABLE)
     d.exec_()
     if d.do_restart:
         QDialog.accept(self)
         from calibre.gui2.ui import get_gui
         gui = get_gui()
         if gui is not None:
             gui.quit(restart=True)
開發者ID:artbycrunk,項目名稱:calibre,代碼行數:12,代碼來源:update.py

示例5: update_found

    def update_found(self, version, force=False, no_show_popup=False):
        try:
            calibre_version, plugin_updates = version.split(VSEP)
            plugin_updates = int(plugin_updates)
        except:
            traceback.print_exc()
            return
        self.last_newest_calibre_version = calibre_version
        has_calibre_update = calibre_version and calibre_version != NO_CALIBRE_UPDATE
        has_plugin_updates = plugin_updates > 0
        self.plugin_update_found(plugin_updates)

        if not has_calibre_update and not has_plugin_updates:
            self.status_bar.update_label.setVisible(False)
            return
        if has_calibre_update:
            plt = u''
            if has_plugin_updates:
                plt = _(' (%d plugin updates)')%plugin_updates
            msg = (u'<span style="color:green; font-weight: bold">%s: '
                    u'<a href="update:%s">%s%s</a></span>') % (
                        _('Update found'), version, calibre_version, plt)
        else:
            msg = (u'<a href="update:%s">%d %s</a>')%(version, plugin_updates,
                    _('updated plugins'))
        self.status_bar.update_label.setText(msg)
        self.status_bar.update_label.setVisible(True)


        if has_calibre_update:
            if (force or (config.get('new_version_notification') and
                    dynamic.get('update to version %s'%calibre_version, True))):
                if not no_show_popup:
                    self._update_notification__ = UpdateNotification(calibre_version,
                            plugin_updates, parent=self)
                    self._update_notification__.show()
        elif has_plugin_updates:
            if force:
                from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog,
                    FILTER_UPDATE_AVAILABLE)
                d = PluginUpdaterDialog(self,
                        initial_filter=FILTER_UPDATE_AVAILABLE)
                d.exec_()
                if d.do_restart:
                    self.quit(restart=True)
開發者ID:yeyanchao,項目名稱:calibre,代碼行數:45,代碼來源:update.py

示例6: update_found

    def update_found(self, calibre_version, number_of_plugin_updates, force=False, no_show_popup=False):
        self.last_newest_calibre_version = calibre_version
        has_calibre_update = calibre_version != NO_CALIBRE_UPDATE
        has_plugin_updates = number_of_plugin_updates > 0
        self.plugin_update_found(number_of_plugin_updates)
        version_url = binascii.hexlify(cPickle.dumps((calibre_version, number_of_plugin_updates), -1))
        calibre_version = u'.'.join(map(unicode, calibre_version))

        if not has_calibre_update and not has_plugin_updates:
            self.status_bar.update_label.setVisible(False)
            return
        if has_calibre_update:
            plt = u''
            if has_plugin_updates:
                plt = _(' (%d plugin updates)')%number_of_plugin_updates
            msg = (u'<span style="color:green; font-weight: bold">%s: '
                    u'<a href="update:%s">%s%s</a></span>') % (
                        _('Update found'), version_url, calibre_version, plt)
        else:
            msg = (u'<a href="update:%s">%d %s</a>')%(version_url, number_of_plugin_updates,
                    _('updated plugins'))
        self.status_bar.update_label.setText(msg)
        self.status_bar.update_label.setVisible(True)

        if has_calibre_update:
            if (force or (config.get('new_version_notification') and
                    dynamic.get('update to version %s'%calibre_version, True))):
                if not no_show_popup:
                    self._update_notification__ = UpdateNotification(calibre_version,
                            number_of_plugin_updates, parent=self)
                    self._update_notification__.show()
        elif has_plugin_updates:
            if force:
                from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog,
                    FILTER_UPDATE_AVAILABLE)
                d = PluginUpdaterDialog(self,
                        initial_filter=FILTER_UPDATE_AVAILABLE)
                d.exec_()
                if d.do_restart:
                    self.quit(restart=True)
開發者ID:AtulKumar2,項目名稱:calibre,代碼行數:40,代碼來源:update.py

示例7: get_plugins

 def get_plugins(self):
     from calibre.gui2.dialogs.plugin_updater import (PluginUpdaterDialog,
         FILTER_UPDATE_AVAILABLE)
     d = PluginUpdaterDialog(self.parent(),
             initial_filter=FILTER_UPDATE_AVAILABLE)
     d.exec_()
開發者ID:AtulKumar2,項目名稱:calibre,代碼行數:6,代碼來源:update.py


注:本文中的calibre.gui2.dialogs.plugin_updater.PluginUpdaterDialog類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。