Improve the display of mat2 when no metadata are found
This should close #74
This commit is contained in:
parent
5e196ecef8
commit
8675706c93
7
mat2
7
mat2
@ -63,7 +63,12 @@ def show_meta(filename: str):
|
|||||||
return
|
return
|
||||||
|
|
||||||
print("[+] Metadata for %s:" % filename)
|
print("[+] Metadata for %s:" % filename)
|
||||||
for k, v in p.get_meta().items():
|
meta = p.get_meta().items()
|
||||||
|
if not meta:
|
||||||
|
print(" No metadata found")
|
||||||
|
return
|
||||||
|
|
||||||
|
for k, v in meta:
|
||||||
try: # FIXME this is ugly.
|
try: # FIXME this is ugly.
|
||||||
print(" %s: %s" % (k, v))
|
print(" %s: %s" % (k, v))
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
|
@ -81,6 +81,7 @@ class TestCleanFolder(unittest.TestCase):
|
|||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
stdout, _ = proc.communicate()
|
stdout, _ = proc.communicate()
|
||||||
self.assertNotIn(b'Comment: Created with GIMP', stdout)
|
self.assertNotIn(b'Comment: Created with GIMP', stdout)
|
||||||
|
self.assertIn(b'No metadata found', stdout)
|
||||||
|
|
||||||
shutil.rmtree('./tests/data/folder/')
|
shutil.rmtree('./tests/data/folder/')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user