diff options
| author | jvoisin | 2018-10-18 21:17:12 +0200 |
|---|---|---|
| committer | jvoisin | 2018-10-18 21:17:12 +0200 |
| commit | 5896387ade9da9319faac6b30cddbad400ccb56d (patch) | |
| tree | badb244ebc463f18d0c6f83f58eaf720547013b0 | |
| parent | d4c050a738e20d6ad41fa01da020e707674300a2 (diff) | |
Output metadata in a sorted fashion
| -rwxr-xr-x | mat2 | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -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: |
