Commit 7b7f149e authored by Janis Streib's avatar Janis Streib

Merge branch 'helper_functions' into 'master'

ADD: New helper functions

See merge request scc-net/net-suite/netdb-client-lib!1
parents 619a465c c5bdc567
Pipeline #112303 passed with stage
in 23 seconds
......@@ -18,7 +18,19 @@ class ArgumentParser(argparse.ArgumentParser):
self.add_argument('--api-version', default=default_api_version,
help='webapi version')
def parse_args(self):
args = super(ArgumentParser, self).parse_args()
def parse_args(self, args=None, namespace=None):
args = super(ArgumentParser, self).parse_args(args, namespace)
return args
def dict_by_value_of_list(array, value):
return ((item[value], item) for item in array)
def dict_of_lists_by_value_of_list(array, value):
res = {}
for item in array:
if not item[value] in res:
res[item[value]] = []
res[item[value]].append(item)
return res
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment