Skip to content

Commit

Permalink
Related to #263. Related to #270.
Browse files Browse the repository at this point in the history
  • Loading branch information
jshcodes committed Aug 13, 2021
1 parent 02d216d commit 0beda03
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/falconpy/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ def generate_b64cred(client_id: str, client_secret: str) -> str:
return encoded


def handle_single_argument(passed_arguments: list, passed_keywords: dict, search_key: str) -> dict:
if len(passed_arguments) > 0: # Argument specification - Using arguments to specify IDs will override
passed_keywords[search_key] = passed_arguments[0] # values specified in the ids keyword or parameters dictionary

return passed_keywords

def force_default(defaults: list, default_types: list = None):
"""
This function forces default values and is designed to decorate other functions.
Expand Down Expand Up @@ -142,8 +148,9 @@ def factory(*args, **kwargs):
# Increment our tracker for our sibling default_types list
element_count += 1
# They passed us an argument but did not specify what it was (non-keyword) [Issue #263]
if len(args) > 1:
args = [args[0]]
# Need to test scenarios with multiple arguments / keyword variations
# if len(args) > 1:
# args = [args[0]]
return func(*args, **kwargs)
return factory
return wrapper
Expand Down

0 comments on commit 0beda03

Please sign in to comment.