Skip to content
Snippets Groups Projects
Commit 54ebad74 authored by Mr. Dmitry Makovey's avatar Mr. Dmitry Makovey
Browse files

make it easier to interact with jq

parent 8014f909
No related branches found
No related tags found
No related merge requests found
......@@ -25,17 +25,17 @@ def get_ml(args):
def held_list(args):
client, ml = get_ml(args)
held_data = {}
held_data = []
for held in ml.held:
if args.fields:
data_hash = {}
for f in args.fields:
data_hash[f] = held.rest_data[f]
held_data[held.request_id] = data_hash
held_data.append(data_hash)
else:
held_data[held.request_id] = held.rest_data
held_data.append(held.rest_data)
if not args.detailed:
del held_data[held.request_id]['msg']
del held_data[-1]['msg']
print json.dumps(held_data, indent=2)
......@@ -60,9 +60,9 @@ def held_reject(args):
def requests_list(args):
client, ml = get_ml(args)
requests_data = {}
requests_data = []
for request in ml.requests:
requests_data[request['token']] = request
requests_data.append(request)
print json.dumps(requests_data, indent=2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment