parser_factory
now returns the mtype too
This commit is contained in:
parent
6c29e0eae2
commit
6868f20065
4 changed files with 8 additions and 9 deletions
|
@ -15,6 +15,6 @@ def get_parser(filename: str):
|
|||
mtype, _ = mimetypes.guess_type(filename)
|
||||
for c in abstract.AbstractParser.__subclasses__():
|
||||
if mtype in c.mimetypes:
|
||||
return c(filename)
|
||||
return c(filename), mtype
|
||||
print('factory: %s is not supported' % mtype)
|
||||
return None
|
||||
return None, mtype
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue