• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python progressQ.send_message函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyanaconda.progress.progressQ.send_message函数的典型用法代码示例。如果您正苦于以下问题:Python send_message函数的具体用法?Python send_message怎么用?Python send_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了send_message函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
开发者ID:Sabayon,项目名称:anaconda,代码行数:33,代码来源:utils.py


示例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})
开发者ID:uofis,项目名称:qubes-installer-qubes-os,代码行数:7,代码来源:livepayload.py


示例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()
开发者ID:uofis,项目名称:qubes-installer-qubes-os,代码行数:35,代码来源:dnfpayload.py


示例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)
开发者ID:jresch,项目名称:anaconda,代码行数:60,代码来源:dnfpayload.py


示例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"))
开发者ID:Sabayon,项目名称:anaconda,代码行数:28,代码来源:livecd.py


示例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()
开发者ID:cs2c-zhangchao,项目名称:nkwin1.0-anaconda,代码行数:7,代码来源:livepayload.py


示例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
开发者ID:Sabayon,项目名称:anaconda,代码行数:8,代码来源:livecd.py


示例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", [])
开发者ID:marmarek,项目名称:qubes-installer-qubes-os,代码行数:10,代码来源:livepayload.py


示例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)
开发者ID:iyogeshjoshi,项目名称:anaconda,代码行数:10,代码来源:dnfpayload.py


示例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)
开发者ID:Sabayon,项目名称:anaconda,代码行数:55,代码来源:utils.py


示例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)
开发者ID:mattdm,项目名称:anaconda,代码行数:11,代码来源:dnfpayload.py


示例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)
开发者ID:Sabayon,项目名称:anaconda,代码行数:13,代码来源:livepayload.py


示例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})
开发者ID:jaymzh,项目名称:anaconda,代码行数:14,代码来源:livepayload.py


示例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()
开发者ID:fabiand,项目名称:anaconda,代码行数:50,代码来源:dnfpayload.py


示例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)
开发者ID:uofis,项目名称:qubes-installer-qubes-os,代码行数:15,代码来源:livepayload.py


示例16: setup_entropy_mirrors

    def setup_entropy_mirrors(self):

        progressQ.send_message("%s: %s" % (
            _("Reordering Entropy mirrors"), _("can take some time..."),))

        chroot = ROOT_PATH
        root = etpSys['rootdir']
        if chroot != root:
            self._change_entropy_chroot(chroot)
        try:
            self._backend.entropy.reorder_mirrors(REPO_NAME)
        except Exception as err:
            log.error("Mirror reordering failure: %s" % (err,))
        finally:
            if chroot != root:
                self._change_entropy_chroot(root)
开发者ID:Sabayon,项目名称:anaconda,代码行数:16,代码来源:utils.py


示例17: postInstall

    def postInstall(self):
        """ Perform post-installation tasks. """
        progressQ.send_message(_("Performing post-installation setup tasks"))
        blivet.util.umount(INSTALL_TREE)

        super().postInstall()

        # Make sure the new system has a machine-id, it won't boot without it
        # (and nor will some of the subsequent commands)
        if not os.path.exists(util.getSysroot() + "/etc/machine-id"):
            log.info("Generating machine ID")
            util.execInSysroot("systemd-machine-id-setup", [])

        for kernel in self.kernelVersionList:
            if flags.blscfg:
                log.info("Regenerating BLS info for %s", kernel)
                util.execInSysroot("kernel-install", ["add", kernel, "/lib/modules/{0}/vmlinuz".format(kernel)])
开发者ID:zhangsju,项目名称:anaconda,代码行数:17,代码来源:livepayload.py


示例18: 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",
            "dev-libs/libreport",
            "dev-libs/satyr",
            "dev-python/python-blivet",
            "dev-python/python-meh",
            "dev-util/pykickstart",
            "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)
开发者ID:jn7163,项目名称:anaconda,代码行数:43,代码来源:utils.py


示例19: post_install

    def post_install(self):
        """ Perform post-installation tasks. """
        progressQ.send_message(_("Performing post-installation setup tasks"))
        payload_utils.unmount(INSTALL_TREE, raise_exc=True)

        super().post_install()

        # Make sure the new system has a machine-id, it won't boot without it
        # (and nor will some of the subsequent commands)
        if not os.path.exists(util.getSysroot() + "/etc/machine-id"):
            log.info("Generating machine ID")
            util.execInSysroot("systemd-machine-id-setup", [])

        for kernel in self.kernel_version_list:
            if not os.path.exists(util.getSysroot() + "/usr/sbin/new-kernel-pkg"):
                log.info("Regenerating BLS info for %s", kernel)
                util.execInSysroot("kernel-install", ["add",
                                                      kernel,
                                                      "/lib/modules/{0}/vmlinuz".format(kernel)])
开发者ID:rvykydal,项目名称:anaconda,代码行数:19,代码来源:livepayload.py


示例20: update_entropy_repositories

    def update_entropy_repositories(self):

        progressQ.send_message(_("Downloading software repositories..."))

        settings = SystemSettings()
        chroot = ROOT_PATH
        root = etpSys['rootdir']
        if chroot != root:
            self._change_entropy_chroot(chroot)

        repos = list(settings['repositories']['available'].keys())

        try:
            # fetch_security = False => avoid spamming stdout
            try:
                repo_intf = self._backend.entropy.Repositories(
                    repos, fetch_security=False)
            except AttributeError as err:
                log.error("No repositories in repositories.conf")
                return False
            except Exception as err:
                log.error("Unhandled exception: %s" % (err,))
                return False

            try:
                update_rc = repo_intf.sync()
            except Exception as err:
                log.error("Sync error: %s" % (err,))
                return False

            if repo_intf.sync_errors or (update_rc != 0):
                log.error("Cannot download repositories atm")
                return False

            return update_rc == 0

        finally:

            self._backend.entropy.close_repositories()
            settings.clear()
            if chroot != root:
                self._change_entropy_chroot(root)
开发者ID:Sabayon,项目名称:anaconda,代码行数:42,代码来源:utils.py



注:本文中的pyanaconda.progress.progressQ.send_message函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python simpleconfig.SimpleConfigFile类代码示例发布时间:2022-05-25
下一篇:
Python nm.nm_devices函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap