Exemplo n.º 1
0
    def filterDriverPacks(self, paths):
        try:
            from panda import Panda
        except ImportError:
            ctx.logger.debug(
                "Installing all driver packages since panda module is not installed."
            )
            return paths

        panda = Panda()

        # filter all driver packages
        foundDriverPackages = set(
            yali.pisiiface.getPathsByPackageName(
                panda.get_all_driver_packages()))
        ctx.logger.debug("Found driver packages: %s" % foundDriverPackages)

        allPackages = set(paths)
        packages = allPackages - foundDriverPackages

        # detect hardware
        neededDriverPackages = set(
            yali.pisiiface.getPathsByPackageName(
                panda.get_needed_driver_packages()))
        ctx.logger.debug("Known driver packages for this hardware: %s" %
                         neededDriverPackages)

        # if alternatives are available ask to user, otherwise return
        if neededDriverPackages and neededDriverPackages.issubset(allPackages):
            answer = ctx.interface.messageWindow(
                _("Proprietary Hardware Drivers"),
                _("<qt>Proprietary drivers are available which may be required "
                  "to utilize the full capabilities of your video card. "
                  "These drivers are developed by the hardware manufacturer "
                  "and not supported by Pisi Linux developers since their "
                  "source code is not publicly available."
                  "<br><br>"
                  "<b>Do you want to install and use these proprietary drivers "
                  "instead of the default drivers?</b></qt>"),
                type="custom",
                customIcon="question",
                customButtons=[_("Yes"), _("No")])

            if answer == 0:
                packages.update(neededDriverPackages)
                ctx.blacklistedKernelModules.append(
                    panda.get_blacklisted_module())
                ctx.logger.debug(
                    "These driver packages will be installed: %s" %
                    neededDriverPackages)

        return list(packages)
Exemplo n.º 2
0
    def filterDriverPacks(self, paths):
        try:
            from panda import Panda
        except ImportError:
            ctx.logger.debug("Installing all driver packages since panda module is not installed.")
            return paths

        panda = Panda()

        # filter all driver packages
        foundDriverPackages = set(yali.pisiiface.getPathsByPackageName(panda.get_all_driver_packages()))
        ctx.logger.debug("Found driver packages: %s" % foundDriverPackages)

        allPackages = set(paths)
        packages = allPackages - foundDriverPackages

        # detect hardware
        neededDriverPackages = set(yali.pisiiface.getPathsByPackageName(panda.get_needed_driver_packages()))
        ctx.logger.debug("Known driver packages for this hardware: %s" % neededDriverPackages)

        # if alternatives are available ask to user, otherwise return
        if neededDriverPackages and neededDriverPackages.issubset(allPackages):
            answer = ctx.interface.messageWindow(
                    _("Proprietary Hardware Drivers"),
                    _("<qt>Proprietary drivers are available which may be required "
                      "to utilize the full capabilities of your video card. "
                      "These drivers are developed by the hardware manufacturer "
                      "and not supported by Pardus developers since their "
                      "source code is not publicly available."
                      "<br><br>"
                      "<b>Do you want to install and use these proprietary drivers "
                      "instead of the default drivers?</b></qt>"),
                      type="custom", customIcon="question",
                      customButtons=[_("Yes"), _("No")])

            if answer == 0:
                packages.update(neededDriverPackages)
                ctx.blacklistedKernelModules.append(panda.get_blacklisted_module())
                ctx.logger.debug("These driver packages will be installed: %s" % neededDriverPackages)

        return list(packages)