1
0
Fork 0
mirror of synced 2025-07-04 12:27:32 +02:00

parser_factory now returns the mtype too

This commit is contained in:
jvoisin 2018-04-02 17:36:26 +02:00
parent 6c29e0eae2
commit 6868f20065
4 changed files with 8 additions and 9 deletions

View file

@ -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