summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2018-10-05 12:35:35 +0200
committerjvoisin2018-10-05 12:35:35 +0200
commit8675706c9385f9a085bfbe568636ee878f68bef1 (patch)
tree75d1c5063d98fefb1a9e0443665684cf7413707e
parent5e196ecef811e80f4f5fc7f9c955b53bc271e7ef (diff)
Improve the display of mat2 when no metadata are found
This should close #74
-rwxr-xr-xmat27
-rw-r--r--tests/test_climat2.py1
2 files changed, 7 insertions, 1 deletions
diff --git a/mat2 b/mat2
index 272cd8f..a49b110 100755
--- a/mat2
+++ b/mat2
@@ -63,7 +63,12 @@ def show_meta(filename: str):
63 return 63 return
64 64
65 print("[+] Metadata for %s:" % filename) 65 print("[+] Metadata for %s:" % filename)
66 for k, v in p.get_meta().items(): 66 meta = p.get_meta().items()
67 if not meta:
68 print(" No metadata found")
69 return
70
71 for k, v in meta:
67 try: # FIXME this is ugly. 72 try: # FIXME this is ugly.
68 print(" %s: %s" % (k, v)) 73 print(" %s: %s" % (k, v))
69 except UnicodeEncodeError: 74 except UnicodeEncodeError:
diff --git a/tests/test_climat2.py b/tests/test_climat2.py
index a1f141c..9bb4ba3 100644
--- a/tests/test_climat2.py
+++ b/tests/test_climat2.py
@@ -81,6 +81,7 @@ class TestCleanFolder(unittest.TestCase):
81 stdout=subprocess.PIPE) 81 stdout=subprocess.PIPE)
82 stdout, _ = proc.communicate() 82 stdout, _ = proc.communicate()
83 self.assertNotIn(b'Comment: Created with GIMP', stdout) 83 self.assertNotIn(b'Comment: Created with GIMP', stdout)
84 self.assertIn(b'No metadata found', stdout)
84 85
85 shutil.rmtree('./tests/data/folder/') 86 shutil.rmtree('./tests/data/folder/')
86 87