summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorjvoisin2018-04-02 17:36:26 +0200
committerjvoisin2018-04-02 17:36:26 +0200
commit6868f20065ef2e46f295c34f27c0736d54283535 (patch)
treea76ef4cf903d763fe4435e282c402f2ebd0d0a82 /main.py
parent6c29e0eae256ddb3d32fd78e9949d0aa81be033e (diff)
`parser_factory` now returns the mtype too
Diffstat (limited to 'main.py')
-rw-r--r--main.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/main.py b/main.py
index 3cff758..877bc70 100644
--- a/main.py
+++ b/main.py
@@ -20,9 +20,8 @@ def create_arg_parser():
20 return parser 20 return parser
21 21
22def show_meta(filename:str): 22def show_meta(filename:str):
23 p = parser_factory.get_parser(filename) 23 p, mtype = parser_factory.get_parser(filename)
24 if p is None: 24 if p is None:
25 mtype, _ = mimetypes.guess_type(filename)
26 print("[-] %s's format (%s) is not supported" % (filename, mtype)) 25 print("[-] %s's format (%s) is not supported" % (filename, mtype))
27 return 26 return
28 for k,v in p.get_meta().items(): 27 for k,v in p.get_meta().items():
@@ -38,9 +37,9 @@ def main():
38 return 0 37 return 0
39 38
40 for f in args.files: 39 for f in args.files:
41 p = parser_factory.get_parser(f) 40 p, mtype = parser_factory.get_parser(f)
42 if p is None: 41 if p is None:
43 print("[-] %s's format (%s) is not supported" % (f, "meh")) 42 print("[-] %s's format (%s) is not supported" % (f, mtype))
44 continue 43 continue
45 p.remove_all() 44 p.remove_all()
46 45