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


Python AptWorker.update_apt_cache方法代碼示例

本文整理匯總了Python中ubuntutweak.utils.package.AptWorker.update_apt_cache方法的典型用法代碼示例。如果您正苦於以下問題:Python AptWorker.update_apt_cache方法的具體用法?Python AptWorker.update_apt_cache怎麽用?Python AptWorker.update_apt_cache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ubuntutweak.utils.package.AptWorker的用法示例。


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

示例1: on_package_work_finished

# 需要導入模塊: from ubuntutweak.utils.package import AptWorker [as 別名]
# 或者: from ubuntutweak.utils.package.AptWorker import update_apt_cache [as 別名]
    def on_package_work_finished(self, transaction, status, add_and_rm):
        to_add, to_rm = add_and_rm

        AptWorker.update_apt_cache(init=True)

        self.emit('call', 'ubuntutweak.modules.updatemanager', 'update_list', {})

        self.appview.to_add = []
        self.appview.to_rm = []
        self.appview.clear_model()
        self.appview.update_model()
開發者ID:nayanapriyankara,項目名稱:ubuntu-tweak,代碼行數:13,代碼來源:appcenter.py

示例2: on_package_work_finished

# 需要導入模塊: from ubuntutweak.utils.package import AptWorker [as 別名]
# 或者: from ubuntutweak.utils.package.AptWorker import update_apt_cache [as 別名]
    def on_package_work_finished(self, transaction, status, kwargs):
        to_add, to_rm = kwargs['add_and_rm']
        parent = kwargs['parent']

        AptWorker.update_apt_cache(init=True)

        self.emit('call', 'ubuntutweak.modules.updatemanager', 'update_list', {})

        self.appview.to_add = []
        self.appview.to_rm = []
        self.on_category_changed(self.cateview.get_selection())
        self.apply_button.set_sensitive(False)
        unset_busy(parent)
開發者ID:c326277320,項目名稱:ubuntu-tweak,代碼行數:15,代碼來源:appcenter.py

示例3: on_clean_finished

# 需要導入模塊: from ubuntutweak.utils.package import AptWorker [as 別名]
# 或者: from ubuntutweak.utils.package.AptWorker import update_apt_cache [as 別名]
 def on_clean_finished(self, transaction, status, parent):
     unset_busy(parent)
     AptWorker.update_apt_cache(True)
     self.emit('cleaned', True)
開發者ID:nayanapriyankara,項目名稱:ubuntu-tweak,代碼行數:6,代碼來源:oldkernel_plugin.py

示例4: old_refresh_source

# 需要導入模塊: from ubuntutweak.utils.package import AptWorker [as 別名]
# 或者: from ubuntutweak.utils.package.AptWorker import update_apt_cache [as 別名]
def old_refresh_source(parent):
    dialog = UpdateCacheDialog(parent)
    dialog.run()

    new_pkg = []
    for pkg in PACKAGE_WORKER.get_new_package():
        if pkg in APP_PARSER:
            new_pkg.append(pkg)

    new_updates = list(PACKAGE_WORKER.get_update_package())

    if new_pkg or new_updates:
        updateview = UpdateView()
        updateview.connect('select', on_select_action)

        if new_pkg:
            updateview.update_model(new_pkg)

        if new_updates:
            updateview.update_updates(new_updates)

        dialog = QuestionDialog(_('You can install new applications by selecting them and choosing "Yes".\nOr you can install them at Application Center by choosing "No".'),
                title=_('New applications are available'))

        vbox = dialog.vbox
        sw = Gtk.ScrolledWindow()
        sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        sw.set_size_request(-1, 200)
        vbox.pack_start(sw, False, False, 0)
        sw.add(updateview)

        select_button = Gtk.CheckButton(_('Select All'))
        select_button.connect('clicked', on_select_button_clicked, updateview)
        vbox.pack_start(select_button, False, False, 0)
        vbox.show_all()

        res = dialog.run()
        dialog.destroy()

        to_rm = updateview.to_rm
        to_add = updateview.to_add

        if res == Gtk.ResponseType.YES and to_add:
            PACKAGE_WORKER.perform_action(parent, to_add, to_rm)

            AptWorker.update_apt_cache(True)

            done = PACKAGE_WORKER.get_install_status(to_add, to_rm)

            if done:
                InfoDialog(_('Update Successful!')).launch()
            else:
                ErrorDialog(_('Update Failed!')).launch()

        return True
    else:
        dialog = InfoDialog(_("Your system is clean and there are no updates yet."),
                        title=_('Software information is now up-to-date'))

        dialog.launch()
        return False
開發者ID:nayanapriyankara,項目名稱:ubuntu-tweak,代碼行數:63,代碼來源:sourcecenter.py


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