本文整理汇总了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', {})