From 2414dd0dcbd098f1500c332929b7e7be9b1b7b24 Mon Sep 17 00:00:00 2001 From: David Hendriks <davidhendriks93@gmail.com> Date: Mon, 23 Mar 2020 15:18:03 +0000 Subject: [PATCH] updated run_system wrapper slightltly --- binarycpython/utils/functions.py | 5 ----- binarycpython/utils/run_system_wrapper.py | 12 +++++++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/binarycpython/utils/functions.py b/binarycpython/utils/functions.py index 2fb54fc69..18371010a 100644 --- a/binarycpython/utils/functions.py +++ b/binarycpython/utils/functions.py @@ -9,11 +9,6 @@ from collections import defaultdict import numpy as np import binary_c_python_api -# from binarycpython.utils.custom_logging_functions import ( -# create_and_load_logging_function, -# ) - - def remove_file(file, verbose=0): """ Function to remove files but with verbosity diff --git a/binarycpython/utils/run_system_wrapper.py b/binarycpython/utils/run_system_wrapper.py index b6f471baf..7166b0318 100644 --- a/binarycpython/utils/run_system_wrapper.py +++ b/binarycpython/utils/run_system_wrapper.py @@ -32,12 +32,16 @@ def run_system(**kwargs): Todo: * Expand functionality. - + * Notify user when an unknown keyword is passed """ # Load available arg keywords available_binary_c_arg_keywords = get_arg_keys() + other_keywords = ['custom_logging_code', 'log_filename', 'parse_function'] + + + # Set default values func_memaddr = -1 write_logfile = 0 @@ -50,6 +54,12 @@ def run_system(**kwargs): if key in available_binary_c_arg_keywords: binary_c_args[key] = kwargs[key] + # Notify user when this key wont be used + else: + if not key in other_keywords: + print("The following keyword was not recognized and wont be used:\n\t{}".format(key)) + + # Check if custom logging is required if "custom_logging_code" in kwargs: func_memaddr, shared_lib_filename = create_and_load_logging_function( -- GitLab