INNER CODE UNIT · Python
parse_and_run
nickjcroucher/gubbins · python/gubbins/common.py:71
def parse_and_run(input_args, program_description=""):
"""Main function of the Gubbins program"""
start_time = time.time()
current_directory = os.getcwd()
printer = utils.VerbosePrinter(True, "\n")
# Process input options
input_args = process_input_arguments(input_args)
# Check if the Gubbins C-program is available. If so, print a welcome message. Otherwise exit.
os.environ["PATH"] = os.environ["PATH"] + ":/usr/lib/gubbins/"
gubbins_exec = 'gubbins'
if utils.which(gubbins_exec) is None:
# Check if the Gubbins C-program is available in its source directory (for tests/CI)
gubbins_python_dir = os.path.dirname(os.path.abspath(utils.__file__))
gubbins_bundled_exec = os.path.abspath(os.path.join(gubbins_python_dir, '../../src/gubbins'))
if utils.which(gubbins_bundled_exec) is None:
sys.exit(gubbins_exec + " is not in your path")
else: