Skip to content

Commit

Permalink
Sort header and query keys to make comparing easier
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrinds committed Mar 25, 2011
1 parent 97bf99f commit a553198
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions har.py
Expand Up @@ -11,14 +11,14 @@ def header_json_repr(d):
{
'name': k,
'value': v
} for k, v in d.iteritems()
} for k, v in sorted(d.items(), key=lambda x: (-1*x[1], x[0]))
]

def query_json_repr(d):
# d = {string: [string]}
# we need to print all values of the list
output = []
for k, l in d.iteritems():
for k, l in sorted(d.items(), key=lambda x: (-1*x[1], x[0])):
for v in l:
output.append({
'name': k,
Expand Down

0 comments on commit a553198

Please sign in to comment.