def backup_packages(self): ''' Build the package list. Then send to the backup server ''' log.info("Backing up packages") package_list = utils.get_packages() f = tempfile.NamedTemporaryFile(delete=False) f.write("\n".join(package_list)) f.close() self.copy_file(f.name, const.PackageFile) os.remove(f.name)
def load_packages(self): self.installed_list = utils.get_packages() s_old = set(self.package_list) s_installed = set(self.installed_list) missing = s_old.difference(s_installed) self.install_packages = list(missing) self.install_packages.sort() self.lstSoftware.Clear() self.lstSoftware.AppendItems(self.install_packages) self.lstSoftware.SetChecked(range(len(self.install_packages))) self.check_packages()