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

#!/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']
python + gtk3 + webkit2 学习笔记
Python 60.1%
JavaScript 37.6%
HTML 2.3%