def depPackages(self, item): QtGui.QApplication.setOverrideCursor(QtCore.Qt.WaitCursor) package = self.cache[(str(item)).strip()] package.mark_delete(True, True) if len(self.cache.get_changes()) > 1: dep_view = AppView(self) text = "These packages depend on {} and they will also be REMOVED.".format(str(item)) dep_view.showView(self.cache.get_changes(), 'Dependent packages', text, False, width=370, height=200, check_state=1) dep_view.show() self.cache.clear() QtGui.QApplication.restoreOverrideCursor()
def removePackages(self): self.logger.info("Removing Programs") try: package = self.cache['snapd'] package.mark_delete(True, True) self.logger.info("Keep Count before commit: {}".format(self.cache.keep_count)) self.logger.info("Delete Count before commit: {}".format(self.cache.delete_count)) self.logger.info("Broken Count before commit: {}".format(self.cache.broken_count)) self.logger.info("Broken Count after commit: {}".format(self.cache.broken_count)) except Exception as e: self.logger.error("Error: [{}]".format(e, exc_info=True)) error = "Problems trying to remove: {}\n{}".format(self.pkg.fullname, str(e)) text = "Package removal failed" self.start_op.emit(error, text)
def removePackages(self): self.logger.info("Removing Programs") try: package = self.cache['snapd'] package.mark_delete(True, True) self.logger.info("Keep Count before commit: {}".format(self.cache.keep_count)) self.logger.info("Delete Count before commit: {}".format(self.cache.delete_count)) self.logger.info("Broken Count before commit: {}".format(self.cache.broken_count)) self.cache.commit(self.aprogress, self.iprogress) self.logger.info("Broken Count after commit: {}".format(self.cache.broken_count)) except Exception as e: self.logger.error("Error: [{}]".format(e, exc_info=True)) error = e.message text = "Package removal failed" self.emit(QtCore.SIGNAL('showError(QString, QString)'), error, text)