This commit is contained in:
parent
3c4a86010d
commit
60e8ecc41a
@ -4,15 +4,15 @@ def object_to_str(obj, keys):
|
||||
for key in keys:
|
||||
value = eval("obj." + key)
|
||||
key = key.replace("()", "")
|
||||
if type(value) == str:
|
||||
if isinstance(value, str):
|
||||
s += f"{key} = {value}\n"
|
||||
elif type(value) == list:
|
||||
elif isinstance(value, list):
|
||||
for idx, vv in enumerate(value):
|
||||
if not vv:
|
||||
s += f"{key}[{idx}] = \n"
|
||||
continue
|
||||
s += f"{key}[{idx}] = {vv}\n"
|
||||
elif type(value) == dict:
|
||||
elif isinstance(value, dict):
|
||||
for vv_key in value.keys():
|
||||
vv_value = value[vv_key]
|
||||
if not vv_value:
|
||||
|
Loading…
Reference in New Issue
Block a user