Improve mime type handling

This commit is contained in:
Lynn Ochs 2019-05-10 23:31:38 +02:00
parent bf691d4b0c
commit ad306ad0e9
Signed by: apo
GPG Key ID: 588AD47B1D06BE99

View File

@ -112,8 +112,8 @@ if __name__ == "__main__":
if rv: if rv:
f, mime = rv f, mime = rv
print(f, mime) print(f, mime)
match = mailcap.findmatch(caps, mime, filename=f) match = mailcap.findmatch(caps, mime.split(';')[0], filename=f)
if match: if match and match[0]:
os.system(match[0]) os.system(match[0])
if 'nodelete' not in match[1]: if 'nodelete' not in match[1]:
os.remove(f) os.remove(f)