From f48e3cbd6c74c1cb30a71b0e57f528577ff5e814 Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 24 Jan 2024 01:39:38 +0100 Subject: Moving bigdealx path management to SquareDeal interface --- pysquaredeal.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pysquaredeal.py') diff --git a/pysquaredeal.py b/pysquaredeal.py index b126b74..6411d10 100644 --- a/pysquaredeal.py +++ b/pysquaredeal.py @@ -8,7 +8,7 @@ argparser = argparse.ArgumentParser(prog='pysquaredeal.py') argparser.add_argument('sqd_file', metavar='SQD_FILE', help='path to SQD file') argparser.add_argument('--sqk-file', metavar='SQK_FILE', help='path to SQK file, if not provided, deduced from SQD file', required=False) argparser.add_argument('--encoding', required=False, default='utf-8', metavar='ENCODING', help='SQD/SQK input file encoding, defaults to UTF-8, output is always UTF-8') -argparser.add_argument('--bigdealx-path', required=False, metavar='BIGDEALX_PATH', help='path to bigdealx executable, defaults to BIGDEALX_PATH environment variable') +argparser.add_argument('--bigdealx-path', required=False, default=os.environ.get('BIGDEALX_PATH'), metavar='BIGDEALX_PATH', help='path to bigdealx executable, defaults to BIGDEALX_PATH environment variable') subparsers = argparser.add_subparsers(title='command-specific arguments', metavar='COMMAND', dest='command') @@ -40,5 +40,8 @@ argparser_generate.add_argument('--reserve', action='store_true', help='generate arguments = argparser.parse_args() + +SquareDeal.BIGDEALX_PATH = arguments.bigdealx_path + sq = SquareDeal() getattr(sq, arguments.command)(**vars(arguments)) -- cgit v1.2.3