本文整理匯總了Python中ubuntutweak.utils.package.AptWorker.update_cache方法的典型用法代碼示例。如果您正苦於以下問題:Python AptWorker.update_cache方法的具體用法?Python AptWorker.update_cache怎麽用?Python AptWorker.update_cache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ubuntutweak.utils.package.AptWorker
的用法示例。
在下文中一共展示了AptWorker.update_cache方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: do_action_for_app
# 需要導入模塊: from ubuntutweak.utils.package import AptWorker [as 別名]
# 或者: from ubuntutweak.utils.package.AptWorker import update_cache [as 別名]
def do_action_for_app(self, pkgname, action_id, *args):
action_id = int(action_id)
if action_id == self.INSTALL_ACTION:
set_busy(self)
worker = AptWorker(self.get_toplevel(),
finish_handler=self.on_package_work_finished,
data={'parent': self})
worker.install_packages([pkgname])
self.update_action_button(self.INSTALLING_ACTION)
elif action_id == self.UNINSTALL_ACTION:
set_busy(self)
worker = AptWorker(self.get_toplevel(),
finish_handler=self.on_package_work_finished,
data={'parent': self})
worker.remove_packages([pkgname])
self.update_action_button(self.UNINSTALLING_ACTION)
elif action_id == self.UPDATE_ACTION:
set_busy(self)
worker = AptWorker(self.get_toplevel(),
finish_handler=self.on_update_work_finished,
data={'parent': self})
worker.update_cache()
self.update_action_button(self.UPDATING_ACTION)
示例2: on_update_button_clicked
# 需要導入模塊: from ubuntutweak.utils.package import AptWorker [as 別名]
# 或者: from ubuntutweak.utils.package.AptWorker import update_cache [as 別名]
def on_update_button_clicked(self, widget):
@log_func(log)
def on_update_finished(transaction, status, parent):
log.debug("on_update_finished")
unset_busy(parent)
set_busy(self)
daemon = AptWorker(widget.get_toplevel(),
finish_handler=on_update_finished,
data=self)
daemon.update_cache()
self.emit('call', 'ubuntutweak.modules.appcenter', 'update_app_data', {})
self.emit('call', 'ubuntutweak.modules.updatemanager', 'update_list', {})
示例3: on_update_button_clicked
# 需要導入模塊: from ubuntutweak.utils.package import AptWorker [as 別名]
# 或者: from ubuntutweak.utils.package.AptWorker import update_cache [as 別名]
def on_update_button_clicked(self, widget):
self.set_busy()
daemon = AptWorker(widget.get_toplevel(), lambda t, s, d: self.unset_busy())
daemon.update_cache()
示例4: on_update_button_clicked
# 需要導入模塊: from ubuntutweak.utils.package import AptWorker [as 別名]
# 或者: from ubuntutweak.utils.package.AptWorker import update_cache [as 別名]
def on_update_button_clicked(self, widget):
daemon = AptWorker(widget.get_toplevel())
daemon.update_cache()
self.emit('call', 'ubuntutweak.modules.appcenter', 'update_app_data', {})
self.emit('call', 'ubuntutweak.modules.updatemanager', 'update_list', {})