summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2018-10-18 21:17:12 +0200
committerjvoisin2018-10-18 21:17:12 +0200
commit5896387ade9da9319faac6b30cddbad400ccb56d (patch)
treebadb244ebc463f18d0c6f83f58eaf720547013b0
parentd4c050a738e20d6ad41fa01da020e707674300a2 (diff)
Output metadata in a sorted fashion
-rwxr-xr-xmat25
1 files changed, 3 insertions, 2 deletions
diff --git a/mat2 b/mat2
index a7a3e73..38c0ede 100755
--- a/mat2
+++ b/mat2
@@ -77,9 +77,10 @@ def __print_meta(filename: str, metadata: dict, depth: int=1):
77 77
78 print("[%s] Metadata for %s:" % ('+'*depth, filename)) 78 print("[%s] Metadata for %s:" % ('+'*depth, filename))
79 79
80 for k, v in metadata.items(): 80 for (k,v) in sorted(metadata.items()):
81 if isinstance(v, dict): 81 if isinstance(v, dict):
82 return __print_meta(k, v, depth+1) 82 __print_meta(k, v, depth+1)
83 continue
83 try: # FIXME this is ugly. 84 try: # FIXME this is ugly.
84 print(padding + " %s: %s" % (k, v)) 85 print(padding + " %s: %s" % (k, v))
85 except UnicodeEncodeError: 86 except UnicodeEncodeError: