def new_config(): """Prompt user for config variables and generate new config. Returns: A new ConfigDict. """ config = ConfigDict() config["module-path"] = qprompt.ask_str("Top-level module path") python_version = qprompt.ask_str( 'Python version (blank for auto detection)') config['python-version'] = python_version timeout = qprompt.ask_str('Test execution timeout (seconds)') config['timeout'] = float(timeout) config['excluded-modules'] = [] config["test-command"] = qprompt.ask_str("Test command") menu = qprompt.Menu() for at_pos, engine_name in enumerate(execution_engine_names()): menu.add(str(at_pos), engine_name) config["execution-engine"] = ConfigDict() config['execution-engine']['name'] = menu.show(header="Execution engine", returns="desc") return config
def new_config(): """Prompt user for config variables and generate new config. Returns: A new ConfigDict. """ config = ConfigDict() config["module-path"] = qprompt.ask_str("Top-level module path", blk=False, vld=os.path.exists, hlp=MODULE_PATH_HELP) python_version = qprompt.ask_str( 'Python version (blank for auto detection)', vld=_validate_python_version, hlp=PYTHON_VERSION_HELP) config['python-version'] = python_version timeout = qprompt.ask_str( 'Test execution timeout (seconds)', vld=float, blk=False, hlp="The number of seconds to let a test run before terminating it.") config['timeout'] = float(timeout) config['excluded-modules'] = [] config["test-command"] = qprompt.ask_str("Test command", blk=False, hlp=TEST_COMMAND_HELP) menu = qprompt.Menu() for at_pos, engine_name in enumerate(execution_engine_names()): menu.add(str(at_pos), engine_name) config["execution-engine"] = ConfigDict() config['execution-engine']['name'] = menu.show(header="Execution engine", returns="desc") config["cloning"] = ConfigDict() config['cloning']['method'] = 'copy' config['cloning']['commands'] = [] config['interceptors'] = ConfigDict() config['interceptors']['enabled'] = [ 'spor', 'pragma_no_mutate', 'operators-filter' ] config['operators-filter'] = ConfigDict() config['operators-filter']['exclude-operators'] = None return config
def new_config(): """Prompt user for config variables and generate new config. Returns: A new ConfigDict. """ config = ConfigDict() config["module-path"] = qprompt.ask_str( "Top-level module path", blk=False, vld=os.path.exists, hlp=MODULE_PATH_HELP) python_version = qprompt.ask_str( 'Python version (blank for auto detection)', vld=_validate_python_version, hlp=PYTHON_VERSION_HELP) config['python-version'] = python_version timeout = qprompt.ask_str( 'Test execution timeout (seconds)', vld=float, blk=False, hlp="The number of seconds to let a test run before terminating it.") config['timeout'] = float(timeout) config['excluded-modules'] = [] config["test-command"] = qprompt.ask_str( "Test command", blk=False, hlp=TEST_COMMAND_HELP) menu = qprompt.Menu() for at_pos, engine_name in enumerate(execution_engine_names()): menu.add(str(at_pos), engine_name) config["execution-engine"] = ConfigDict() config['execution-engine']['name'] = menu.show(header="Execution engine", returns="desc") config["cloning"] = ConfigDict() config['cloning']['method'] = 'copy' config['cloning']['commands'] = [] return config
def new_config(): """Prompt user for config variables and generate new config. Returns: A new configuration as a single string. """ conf = {'module': qprompt.ask_str("Top-level module")} menu = qprompt.Menu() test_runners = test_runner_names() for at_pos, test_runner in enumerate(test_runners): menu.add(str(at_pos), test_runner) conf['test_runner'] = menu.show(header="Test runner", returns="desc") conf['test_args'] = qprompt.ask_str('Test args') menu = qprompt.Menu() for at_pos, engine_name in enumerate(execution_engine_names()): menu.add(str(at_pos), engine_name) conf['engine'] = menu.show(header="Execution engine", returns="desc") return TEMPLATE.format(**conf)