diff --git a/kibot/kiplot.py b/kibot/kiplot.py index 99c98f41..64df30bc 100644 --- a/kibot/kiplot.py +++ b/kibot/kiplot.py @@ -22,10 +22,10 @@ from collections import OrderedDict from .gs import GS from .registrable import RegOutput -from .misc import (PLOT_ERROR, MISSING_TOOL, CMD_EESCHEMA_DO, URL_EESCHEMA_DO, CORRUPTED_PCB, - EXIT_BAD_ARGS, CORRUPTED_SCH, EXIT_BAD_CONFIG, WRONG_INSTALL, UI_SMD, UI_VIRTUAL, TRY_INSTALL_CHECK, - MOD_SMD, MOD_THROUGH_HOLE, MOD_VIRTUAL, W_PCBNOSCH, W_NONEEDSKIP, W_WRONGCHAR, name2make, W_TIMEOUT, - W_KIAUTO, W_VARSCH, NO_SCH_FILE, NO_PCB_FILE, W_VARPCB, NO_YAML_MODULE, WRONG_ARGUMENTS) +from .misc import (PLOT_ERROR, MISSING_TOOL, CORRUPTED_PCB, EXIT_BAD_ARGS, CORRUPTED_SCH, + EXIT_BAD_CONFIG, WRONG_INSTALL, UI_SMD, UI_VIRTUAL, TRY_INSTALL_CHECK, MOD_SMD, MOD_THROUGH_HOLE, + MOD_VIRTUAL, W_PCBNOSCH, W_NONEEDSKIP, W_WRONGCHAR, name2make, W_TIMEOUT, W_KIAUTO, W_VARSCH, + NO_SCH_FILE, NO_PCB_FILE, W_VARPCB, NO_YAML_MODULE, WRONG_ARGUMENTS) from .error import PlotError, KiPlotConfigurationError, config_error, trace_dump from .config_reader import CfgYamlReader from .pre_base import BasePreFlight @@ -121,20 +121,6 @@ def check_version(command, version): script_versions[command] = res[0] -def check_script(cmd, url, version=None): - if which(cmd) is None and not os.path.isfile(cmd): - logger.error('No `'+cmd+'` command found.\n' - 'Please install it, visit: '+url) - logger.error(TRY_INSTALL_CHECK) - exit(MISSING_TOOL) - if version is not None: - check_version(cmd, version) - - -def check_eeschema_do(): - check_script(CMD_EESCHEMA_DO, URL_EESCHEMA_DO, '1.5.4') - - def extract_errors(text): in_error = in_warning = False msg = '' diff --git a/tests/test_plot/test_script_checks.py b/tests/test_plot/test_script_checks.py index b9ded1c9..43be160e 100644 --- a/tests/test_plot/test_script_checks.py +++ b/tests/test_plot/test_script_checks.py @@ -9,26 +9,14 @@ pytest-3 --log-cli-level debug import pytest import coverage from . import context # noqa: F401 -from kibot.misc import (MISSING_TOOL, CMD_EESCHEMA_DO) -from kibot.kiplot import (check_script, check_version) +from kibot.misc import MISSING_TOOL, CMD_EESCHEMA_DO +from kibot.kiplot import check_version import kibot.kiplot cov = coverage.Coverage() -def test_check_script(caplog): - cov.load() - cov.start() - with pytest.raises(SystemExit) as pytest_wrapped_e: - check_script('bogus', '') - cov.stop() - cov.save() - assert pytest_wrapped_e.type == SystemExit - assert pytest_wrapped_e.value.code == MISSING_TOOL - assert "No `bogus` command found" in caplog.text - - def test_check_version_1(caplog): cov.load() cov.start()