25 lines
781 B
Python
Executable File
25 lines
781 B
Python
Executable File
#!/usr/bin/env python2
|
|
import os
|
|
import json
|
|
|
|
def format_param(param, value):
|
|
return '-' + param + '=' + value
|
|
|
|
script_dir = os.path.dirname(os.path.abspath(__file__))
|
|
# Look for assetchains.json in same dir first, then in src/
|
|
json_path = os.path.join(script_dir, 'assetchains.json')
|
|
if not os.path.exists(json_path):
|
|
json_path = os.path.join(script_dir, '..', '..', 'src', 'assetchains.json')
|
|
with open(json_path) as file:
|
|
assetchains = json.load(file)
|
|
|
|
for chain in assetchains:
|
|
params = []
|
|
for param, value in chain.items():
|
|
if isinstance(value, list):
|
|
for dupe_value in value:
|
|
params.append(format_param(param, dupe_value))
|
|
else:
|
|
params.append(format_param(param, value))
|
|
print(' '.join(params))
|