|
|
|
@ -99,16 +99,19 @@ def add_dict_list(keys, value, dict_map):
|
|
|
|
|
else:
|
|
|
|
|
dict_map[key] = [value]
|
|
|
|
|
|
|
|
|
|
def get_list(data, lower=False, split=True, int_list=False):
|
|
|
|
|
def get_list(data, lower=False, upper=False, split=True, int_list=False):
|
|
|
|
|
if data is None: return None
|
|
|
|
|
elif isinstance(data, list): return data
|
|
|
|
|
elif isinstance(data, list): list_data = data
|
|
|
|
|
elif isinstance(data, dict): return [data]
|
|
|
|
|
elif split is False: return [str(data)]
|
|
|
|
|
elif lower is True: return [d.strip().lower() for d in str(data).split(",")]
|
|
|
|
|
else: list_data = str(data).split(",")
|
|
|
|
|
|
|
|
|
|
if lower is True: return [d.strip().lower() for d in list_data]
|
|
|
|
|
elif upper is True: return [d.strip().upper() for d in list_data]
|
|
|
|
|
elif int_list is True:
|
|
|
|
|
try: return [int(d.strip()) for d in str(data).split(",")]
|
|
|
|
|
try: return [int(d.strip()) for d in list_data]
|
|
|
|
|
except ValueError: return []
|
|
|
|
|
else: return [d.strip() for d in str(data).split(",")]
|
|
|
|
|
else: return [d.strip() for d in list_data]
|
|
|
|
|
|
|
|
|
|
def get_int_list(data, id_type):
|
|
|
|
|
int_values = []
|
|
|
|
|