本文整理汇总了Python中pyanaconda.progress.progressQ.send_message函数的典型用法代码示例。如果您正苦于以下问题:Python send_message函数的具体用法?Python send_message怎么用?Python send_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了send_message函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: maybe_install_packages
def maybe_install_packages(self, packages):
chroot = ROOT_PATH
root = etpSys['rootdir']
install = []
if chroot != root:
self._change_entropy_chroot(chroot)
try:
repo = self._backend.entropy.installed_repository()
for package in packages:
pkg_id, _pkg_rc = repo.atomMatch(package)
if pkg_id == -1:
install.append(package)
if not install:
return
updated = self.update_entropy_repositories()
if not updated:
return # ouch
for package in install:
progressQ.send_message(
_("Installing package: %s") % (package,))
self.install_package(package)
finally:
if chroot != root:
self._change_entropy_chroot(root)
示例2: end
def end(self, bytes_read):
""" Download complete
:param bytes_read: Bytes read so far
:type bytes_read: int
"""
progressQ.send_message(_("Downloading %(url)s (%(pct)d%%)") % {"url": self.url, "pct": 100})
示例3: install
def install(self):
progressQ.send_message(_("Starting package installation process"))
if self.install_device:
self._setupMedia(self.install_device)
try:
self.checkSoftwareSelection()
except packaging.DependencyError as e:
if errors.errorHandler.cb(e) == errors.ERROR_RAISE:
_failure_limbo()
pkgs_to_download = self._base.transaction.install_set
log.info("Downloading pacakges.")
progressQ.send_message(_("Downloading packages"))
self._base.download_packages(pkgs_to_download)
log.info("Downloading packages finished.")
pre_msg = _("Preparing transaction from installation source")
progressQ.send_message(pre_msg)
queue = multiprocessing.Queue()
process = multiprocessing.Process(target=do_transaction, args=(self._base, queue))
process.start()
(token, msg) = queue.get()
while token not in ("post", "quit"):
if token == "install":
msg = _("Installing %s") % msg
progressQ.send_message(msg)
(token, msg) = queue.get()
if token == "quit":
_failure_limbo()
post_msg = _("Performing post-installation setup tasks")
progressQ.send_message(post_msg)
process.join()
示例4: install
def install(self):
progressQ.send_message(_('Starting package installation process'))
# Add the rpm macros to the global transaction environment
for macro in self.rpmMacros:
rpm.addMacro(macro[0], macro[1])
if self.install_device:
self._setupMedia(self.install_device)
try:
self.checkSoftwareSelection()
self._download_location = self._pick_download_location()
except packaging.PayloadError as e:
if errors.errorHandler.cb(e) == errors.ERROR_RAISE:
_failure_limbo()
pkgs_to_download = self._base.transaction.install_set
log.info('Downloading packages.')
progressQ.send_message(_('Downloading packages'))
progress = DownloadProgress()
try:
self._base.download_packages(pkgs_to_download, progress)
except dnf.exceptions.DownloadError as e:
msg = 'Failed to download the following packages: %s' % str(e)
exc = packaging.PayloadInstallError(msg)
if errors.errorHandler.cb(exc) == errors.ERROR_RAISE:
_failure_limbo()
log.info('Downloading packages finished.')
pre_msg = _("Preparing transaction from installation source")
progressQ.send_message(pre_msg)
queue_instance = multiprocessing.Queue()
process = multiprocessing.Process(target=do_transaction,
args=(self._base, queue_instance))
process.start()
(token, msg) = queue_instance.get()
while token not in ('post', 'quit'):
if token == 'install':
msg = _("Installing %s") % msg
progressQ.send_message(msg)
(token, msg) = queue_instance.get()
if token == 'quit':
_failure_limbo()
post_msg = _("Performing post-installation setup tasks")
progressQ.send_message(post_msg)
process.join()
self._base.close()
if os.path.exists(self._download_location):
log.info("Cleaning up downloaded packages: %s", self._download_location)
shutil.rmtree(self._download_location)
else:
# Some installation sources, such as NFS, don't need to download packages to
# local storage, so the download location might not always exist. So for now
# warn about this, at least until the RFE in bug 1193121 is implemented and
# we don't have to care about clearing the download location ourselves.
log.warning("Can't delete nonexistent download location: %s", self._download_location)
示例5: postInstall
def postInstall(self):
super(LiveCDCopyBackend, self).postInstall()
log.info("Preparing to configure Sabayon (backend postInstall)")
self._sabayon_install.spawn_chroot(
["/usr/bin/systemd-machine-id-setup"]
)
self._sabayon_install.setup_secureboot()
self._sabayon_install.setup_sudo()
self._sabayon_install.remove_proprietary_drivers()
self._sabayon_install.setup_nvidia_legacy()
self._sabayon_install.configure_skel()
self._sabayon_install.configure_services()
self._sabayon_install.spawn_chroot(["env-update"])
self._sabayon_install.spawn_chroot(["ldconfig"])
if self._packages:
log.info("Preparing to install these packages: %s" % (
self._packages,))
self._sabayon_install.setup_entropy_mirrors()
self._sabayon_install.maybe_install_packages(self._packages)
self._sabayon_install.configure_boot_args()
self._sabayon_install.emit_install_done()
progressQ.send_message(_("Sabayon configuration complete"))
示例6: postInstall
def postInstall(self):
""" Perform post-installation tasks. """
progressQ.send_message(_("Performing post-installation setup tasks"))
blivet.util.umount(INSTALL_TREE)
super(LiveImagePayload, self).postInstall()
self._recreateInitrds()
示例7: preInstall
def preInstall(self, packages=None, groups=None):
""" Perform pre-installation tasks. """
super(LiveCDCopyBackend, self).preInstall(
packages=packages, groups=groups)
progressQ.send_message(_("Installing software") + (" %d%%") % (0,))
self._sabayon_install = utils.SabayonInstall(self)
self._packages = packages
示例8: postInstall
def postInstall(self):
""" Perform post-installation tasks. """
progressQ.send_message(_("Performing post-installation setup tasks"))
blivet.util.umount(INSTALL_TREE)
super(LiveImagePayload, self).postInstall()
# Make sure the new system has a machine-id, it won't boot without it
if not os.path.exists(iutil.getSysroot()+"/etc/machine-id"):
iutil.execInSysroot("systemd-machine-id-setup", [])
示例9: _update
def _update(self):
msg = _("Downloading %(total_files)s RPMs, " "%(downloaded)s / %(total_size)s (%(percent)d%%) done.")
downloaded = Size(sum(self.downloads.values()))
vals = {
"downloaded": downloaded,
"percent": int(100 * downloaded / self.total_size),
"total_files": self.total_files,
"total_size": self.total_size,
}
progressQ.send_message(msg % vals)
示例10: cleanup_packages
def cleanup_packages(self):
progressQ.send_message(_("Removing install packages..."))
packages = [
"app-arch/rpm",
"app-admin/anaconda",
"app-admin/authconfig",
"app-admin/calamares-sabayon",
"app-admin/calamares-sabayon-branding",
"app-admin/calamares-sabayon-base-modules",
"app-admin/calamares",
"app-admin/setools",
"app-emulation/spice-vdagent",
"app-i18n/langtable",
"dev-libs/libreport",
"dev-libs/libtimezonemap",
"dev-libs/satyr",
"dev-python/ipy",
"dev-python/pyblock",
"dev-python/python-bugzilla",
"dev-python/python-blivet",
"dev-python/python-meh",
"dev-python/python-nss",
"dev-python/pyparted",
"dev-python/sepolgen",
"dev-util/pykickstart",
"net-misc/fcoe-utils",
"net-misc/tightvnc",
"sys-apps/policycoreutils",
"sys-libs/libsemanage",
"sys-libs/libsepol",
"libselinux",
"sys-process/audit",
]
chroot = ROOT_PATH
root = etpSys['rootdir']
if chroot != root:
self._change_entropy_chroot(chroot)
try:
repo = self._backend.entropy.installed_repository()
for package in packages:
pkg_id, _pkg_rc = repo.atomMatch(package)
if pkg_id == -1:
continue
self.remove_package(package)
finally:
if chroot != root:
self._change_entropy_chroot(root)
示例11: _update
def _update(self):
msg = _('Downloading %(total_files)s RPMs, '
'%(downloaded)s / %(total_size)s (%(percent)d%%) done.')
downloaded = Size(sum(self.downloads.values()))
vals = {
'downloaded' : downloaded,
'percent' : int(100 * downloaded/self.total_size),
'total_files' : self.total_files,
'total_size' : self.total_size
}
progressQ.send_message(msg % vals)
示例12: postInstall
def postInstall(self):
""" Perform post-installation tasks. """
progressQ.send_message(_("Performing post-installation setup tasks"))
blivet.util.umount(INSTALL_TREE)
super(LiveImagePayload, self).postInstall()
# Live needs to create the rescue image before bootloader is written
for kernel in self.kernelVersionList:
log.info("Generating rescue image for %s", kernel)
iutil.execWithRedirect("new-kernel-pkg",
["--rpmposttrans", kernel],
root=ROOT_PATH)
示例13: update
def update(self, bytes_read):
""" Download update
:param bytes_read: Bytes read so far
:type bytes_read: int
"""
if not bytes_read:
return
pct = min(100, int(100 * bytes_read / self.size))
if pct == self._pct:
return
self._pct = pct
progressQ.send_message(_("Downloading %(url)s (%(pct)d%%)") % {"url": self.url, "pct": pct})
示例14: install
def install(self):
progressQ.send_message(_('Starting package installation process'))
# Add the rpm macros to the global transaction environment
for macro in self.rpmMacros:
rpm.addMacro(macro[0], macro[1])
if self.install_device:
self._setupMedia(self.install_device)
try:
self.checkSoftwareSelection()
self._pick_download_location()
except packaging.PayloadError as e:
if errors.errorHandler.cb(e) == errors.ERROR_RAISE:
_failure_limbo()
pkgs_to_download = self._base.transaction.install_set
log.info('Downloading pacakges.')
progressQ.send_message(_('Downloading packages'))
progress = DownloadProgress()
try:
self._base.download_packages(pkgs_to_download, progress)
except dnf.exceptions.DownloadError as e:
msg = 'Failed to download the following packages: %s' % str(e)
exc = packaging.PayloadInstallError(msg)
if errors.errorHandler.cb(exc) == errors.ERROR_RAISE:
_failure_limbo()
log.info('Downloading packages finished.')
pre_msg = _("Preparing transaction from installation source")
progressQ.send_message(pre_msg)
queue = multiprocessing.Queue()
process = multiprocessing.Process(target=do_transaction,
args=(self._base, queue))
process.start()
(token, msg) = queue.get()
while token not in ('post', 'quit'):
if token == 'install':
msg = _("Installing %s") % msg
progressQ.send_message(msg)
(token, msg) = queue.get()
if token == 'quit':
_failure_limbo()
post_msg = _("Performing post-installation setup tasks")
progressQ.send_message(post_msg)
process.join()
示例15: postInstall
def postInstall(self):
""" Perform post-installation tasks. """
progressQ.send_message(_("Performing post-installation setup tasks"))
blivet.util.umount(INSTALL_TREE)
super(LiveImagePayload, self).postInstall()
# Live needs to create the rescue image before bootloader is written
for kernel in self.kernelVersionList:
log.info("Generating rescue image for %s", kernel)
iutil.execWithRedirect("new-kernel-pkg", ["--rpmposttrans", kernel], root=ROOT_PATH)
# Make sure the new system has a machine-id, it won't boot without it
if not os.path.exists(ROOT_PATH + "/etc/machine-id"):
iutil.execWithRedirect("systemd-machine-id-setup", [], root=ROOT_PATH)