Пример #1
0
 def checkActivation(self, plugins):
     missing = {}
     for pluginInfo in plugins:
         if pluginInfo.details.has_option("Requirements", "pip"):
             from lunchinator.utilities import checkRequirements
             checkRequirements(pluginInfo.details.get("Requirements", "pip").split(";;"),
                               (pluginInfo.name, pluginInfo.category),
                               pluginInfo.plugin_object.get_displayed_name(),
                               missing)
     return missing
Пример #2
0
def installCoreDependencies():
    requirements = getCoreDependencies()
    missing = checkRequirements(requirements, u"Lunchinator", u"Lunchinator")
    result = handleMissingDependencies(missing, optionalCallback=lambda req: not "yapsy" in req.lower())
    if result == INSTALL_CANCEL:
        return False

    try:
        import yapsy

        if lunchinator_has_gui():
            from PyQt4.QtGui import QMessageBox

            if result == INSTALL_SUCCESS:
                QMessageBox.information(
                    None,
                    "Success",
                    "Dependencies were installed successfully.",
                    buttons=QMessageBox.Ok,
                    defaultButton=QMessageBox.Ok,
                )
            elif result == INSTALL_FAIL:
                QMessageBox.warning(
                    None,
                    "Errors during installation",
                    "There were errors during installation, but Lunchinator might work anyways. If you experience problems with some plugins, try to install the required libraries manually using pip.",
                )
            return True
        getCoreLogger().info("yapsy is working after dependency installation")
        # without gui there are enough messages on the screen already
    except:
        if lunchinator_has_gui():
            try:
                from PyQt4.QtGui import QMessageBox

                QMessageBox.critical(
                    None,
                    "Error installing dependencies",
                    "There was an error, the dependencies could not be installed. Continuing without plugins.",
                )
            except:
                getCoreLogger().error(
                    "There was an error, the dependencies could not be installed. Continuing without plugins."
                )
        getCoreLogger().error(
            "Lunchinator is running without plugins because of missing dependencies. \
                Try executing 'lunchinator --install-dependencies' to install them automatically."
        )
        return False