Пример #1
0
 def setUpClass(cls):
     """
     Loads all enabled plugins before running
     """
     hooks.load_plugins()
     logging.VERBOSE = logging.DEBUG
     logging.verbose = logging.debug
Пример #2
0
def main(__interactive__: bool, force: bool) -> None:
    """
    Updates the configuration if the program is to be run interactively,
    then install necessary items
    :param __interactive__: if the config has to be updated
    :param force: True to force reinstall of the programs, else will only install the ones that are not installed
    """
    if __interactive__ and update.update():
        logging.error("An error occurred, could not finish configuration")
        return 1

    try:
        install(force)
        setup_coredumps()

        hooks.load_plugins()
        hooks.configure(force)
    except (exceptions.InstallationErrorException,
            exceptions.DistributionNotSupportedException) as exception:
        logging.error(exception)
        logging.error(
            "Configure script failed. Please rerun it after correcting errors. You can add --default in order"
            " to skip questions")
        return 1

    finally:
        logging.verbose("Cleaning environment")
Пример #3
0
 def setUpClass(cls):
     """
     Loads all enabled plugins before running
     """
     hooks.load_plugins()
     logging.VERBOSE = logging.DEBUG
     logging.verbose = logging.debug
Пример #4
0
def main(__interactive__: bool, force: bool) -> None:
    """
    Updates the configuration if the program is to be run interactively,
    then install necessary items
    :param __interactive__: if the config has to be updated
    :param force: True to force reinstall of the programs, else will only install the ones that are not installed
    """
    if __interactive__ and update.update():
        logging.error("An error occurred, could not finish configuration")
        return 1

    try:
        install(force)
        setup_coredumps()

        hooks.load_plugins()
        hooks.configure(force)
    except (exceptions.InstallationErrorException, exceptions.DistributionNotSupportedException) as exception:
        logging.error(exception)
        logging.error("Configure script failed. Please rerun it after correcting errors. You can add --default in order"
                      " to skip questions")
        return 1

    finally:
        logging.verbose("Cleaning environment")
Пример #5
0
            try:
                logger.start_new_log_section(bug, "triggering")
                return_values.append(
                    trigger_bug(bug=bug, main_plugin=plugin, **kwargs))
            except (PluginIncompatibleException,
                    ProgramNotInstalledException) as exc:
                logging.warning(exc)
                exceptions.append(exc)

    err = None
    if isinstance(main_plugin, MetaPlugin):
        err = after_run(main_plugin=main_plugin,
                        plugins=main_plugins,
                        bugs=bugs,
                        return_values=return_values,
                        exceptions=exceptions,
                        **kwargs)
    elif len(exceptions):
        err = 1

    return err or any(return_values)


if __name__ == "__main__":
    try:
        logger.setup_logging()
        load_plugins()
        exit(main(**parse_args(sys.argv[1:])))
    except KeyboardInterrupt:
        exit(1)
Пример #6
0
        installer = InstallerProcess([
            Installer.factory(program_conf[prog], force_installation)
            for prog in program_conf.sections()
        ], report_queue, max_tasks)
        installer.start()
        installers.append(installer)

    return_value = 0
    counter = 0
    for _ in installers:
        counter += 1
        value, program = report_queue.get(block=True)
        if value:
            return_value = value
            logging.error("%(prog)s failed to compile correctly",
                          dict(prog=program))

        show_progress(counter, len(installers))

    return return_value


if __name__ == "__main__":
    try:
        lib.logger.setup_logging()
        hooks.load_plugins()
        exit(main(**parse_args()))
    except KeyboardInterrupt:
        exit(1)
Пример #7
0
            try:
                logger.start_new_log_section(bug, "triggering")
                return_values.append(trigger_bug(bug=bug, main_plugin=plugin, **kwargs))
            except (PluginIncompatibleException, ProgramNotInstalledException) as exc:
                logging.warning(exc)
                exceptions.append(exc)

    err = None
    if isinstance(main_plugin, MetaPlugin):
        err = after_run(
            main_plugin=main_plugin,
            plugins=main_plugins,
            bugs=bugs,
            return_values=return_values,
            exceptions=exceptions,
            **kwargs
        )
    elif len(exceptions):
        err = 1

    return err or any(return_values)


if __name__ == "__main__":
    try:
        logger.setup_logging()
        load_plugins()
        exit(main(**parse_args(sys.argv[1:])))
    except KeyboardInterrupt:
        exit(1)
Пример #8
0
        installer = InstallerProcess(
            [Installer.factory(program_conf[prog], force_installation) for prog in program_conf.sections()],
            report_queue,
            max_tasks,
        )
        installer.start()
        installers.append(installer)

    return_value = 0
    counter = 0
    for _ in installers:
        counter += 1
        value, program = report_queue.get(block=True)
        if value:
            return_value = value
            logging.error("%(prog)s failed to compile correctly", dict(prog=program))

        show_progress(counter, len(installers))

    return return_value


if __name__ == "__main__":
    try:
        lib.logger.setup_logging()
        hooks.load_plugins()
        exit(main(**parse_args()))
    except KeyboardInterrupt:
        exit(1)