本文整理匯總了Python中ubuntutweak.utils.package.AptWorker.remove_packages方法的典型用法代碼示例。如果您正苦於以下問題:Python AptWorker.remove_packages方法的具體用法?Python AptWorker.remove_packages怎麽用?Python AptWorker.remove_packages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ubuntutweak.utils.package.AptWorker
的用法示例。
在下文中一共展示了AptWorker.remove_packages方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: do_action_for_app
# 需要導入模塊: from ubuntutweak.utils.package import AptWorker [as 別名]
# 或者: from ubuntutweak.utils.package.AptWorker import remove_packages [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: clean_cruft
# 需要導入模塊: from ubuntutweak.utils.package import AptWorker [as 別名]
# 或者: from ubuntutweak.utils.package.AptWorker import remove_packages [as 別名]
def clean_cruft(self, parent=None, cruft_list=[]):
set_busy(parent)
worker = AptWorker(parent,
finish_handler=self.on_clean_finished,
error_handler=self.on_error,
data=parent)
worker.remove_packages([cruft.get_package_name() for cruft in cruft_list])
示例3: on_install_finished
# 需要導入模塊: from ubuntutweak.utils.package import AptWorker [as 別名]
# 或者: from ubuntutweak.utils.package.AptWorker import remove_packages [as 別名]
def on_install_finished(transaction, status, kwargs):
to_add, to_rm = kwargs['add_and_rm']
if to_rm:
worker = AptWorker(self.get_toplevel(),
finish_handler=self.on_package_work_finished,
data=kwargs)
worker.remove_packages(to_rm)
else:
self.on_package_work_finished(None, None, kwargs)
示例4: clean_cruft
# 需要導入模塊: from ubuntutweak.utils.package import AptWorker [as 別名]
# 或者: from ubuntutweak.utils.package.AptWorker import remove_packages [as 別名]
def clean_cruft(self, parent, cruft_list):
set_busy(parent)
worker = AptWorker(parent, self.on_clean_finished, parent)
worker.remove_packages([cruft.get_package_name() for cruft in cruft_list])
示例5: on_clean_finished
# 需要導入模塊: from ubuntutweak.utils.package import AptWorker [as 別名]
# 或者: from ubuntutweak.utils.package.AptWorker import remove_packages [as 別名]
def on_clean_finished(transaction, status, add_and_rm):
to_add, to_rm = add_and_rm
worker = AptWorker(self.get_toplevel(), self.on_package_work_finished, add_and_rm)
worker.remove_packages(to_rm)