DNAME = "out"
+def sort_dict(f):
+ """Sort dict returned by ``f``."""
+ def w(*args, **kwargs):
+ d = f(*args, **kwargs)
+ d = {k: v for k, v in sorted(d.items(), key=lambda i: i[0])}
+ return d
+ return w
+
def load(fname):
"""Load scenario from file.
scenarios.append(s)
return scenarios
+@sort_dict
def grep_all(what="time"):
"""Return the dictionary of ``fname``'s and corresponding list of values.
filtered[s["fname"]].append(-1)
return filtered
+@sort_dict
def grep(what="time"):
"""Return the dictionary of ``fname``'s and corresponding list of values.