From 0dc2964ed8c1e1714486fc251dc202778d93e014 Mon Sep 17 00:00:00 2001
From: Simon Magnin-Feysot <simon.magnin-feysot@nbs-system.com>
Date: Thu, 11 Oct 2018 17:02:50 +0200
Subject: [PATCH] refactor and correct CI

---
 mat2 | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/mat2 b/mat2
index 295afd5..b06e65e 100755
--- a/mat2
+++ b/mat2
@@ -58,7 +58,6 @@ def create_arg_parser() -> argparse.ArgumentParser:
 
 
 def show_meta(filename: str):
-    recursive_mtype = ["application/zip"]
     if not __check_file(filename):
         return
 
@@ -68,24 +67,23 @@ def show_meta(filename: str):
     if p is None:
         print("[-] %s's format (%s) is not supported" % (filename, mtype))
         return
-    print_meta(metadata)
+    __print_meta(metadata)
 
 
-def print_meta(metadata: dict):
+def __print_meta(metadata: dict):
     if not metadata:
         print("  No metadata found")
         return
 
     for k, v in metadata:
-        zipmeta = v
-        zipmeta_name = k
-        try:  # FIXME this is ugly.
-            if not isinstance(zipmeta, dict):
+        if not isinstance(v, dict):
+            try:  # FIXME this is ugly.
                 print("  %s: %s" % (k, v))
-            else:
-                print_meta(v)
-        except UnicodeEncodeError:
-            print("  %s: harmful content" % k)
+            except UnicodeEncodeError:
+                print("  %s: harmful content" % k)
+        else:
+            __print_meta(v)
+    return
 
 
 def clean_meta(filename: str, is_lightweight: bool, policy: UnknownMemberPolicy) -> bool:
-- 
GitLab