This repository has been archived on 2023-09-06. You can view files and clone it, but cannot push or open issues/pull-requests.
yutent
/
py-gtk-notes
Archived
1
0
Fork 0
py-gtk-notes/notes/mimetypes.py

34 lines
761 B
Python
Raw Normal View History

2023-07-31 16:19:19 +08:00
#!/usr/bin/env python3
mime_types = {
'html': 'text/html',
'txt': 'text/plain',
'css': 'text/css',
'xml': 'text/xml',
'gif': 'image/gif',
'jpg': 'image/jpeg',
'webp': 'image/webp',
'tiff': 'image/tiff',
'png': 'image/png',
'svg': 'image/svg+xml',
'ico': 'image/x-icon',
'bmp': 'image/x-ms-bmp',
'js': 'application/javascript',
'json': 'application/json',
'mp3': 'audio/mpeg',
'ogg': 'audio/ogg',
'm4a': 'audio/x-m4a',
'mp4': 'video/mp4',
'webm': 'video/webm',
'ttf': 'font/font-ttf',
'woff': 'font/font-woff',
'woff2': 'font/font-woff2',
'wast': 'application/wast',
'wasm': 'application/wasm',
'other': 'application/octet-stream'
}
def get_mimetype(name):
return mime_types.get(name) or mime_types['html']