Improve mime type handling
This commit is contained in:
parent
bf691d4b0c
commit
ad306ad0e9
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user