Exemplo n.º 1
0
def getDecoder(filename):
	from mime import MimeType
	from . import codecs
	
	filename = filename.lower()
	mime = MimeType.fromName(filename)
	
	if mime == "image/png":
		return codecs.PNG
	
	if mime == "image/vnd.microsoft.icon":
		return codecs.ICO
	
	if filename.endswith(".blp"):
		return codecs.BLP
	
	if filename.endswith(".ftc") or filename.endswith(".ftu"):
		return codecs.FTEX
Exemplo n.º 2
0
		def _cachedMimeType(self_):
			if not hasattr(self_, "_mimetype"):
				self_._mimetype = MimeType.fromName(self_.filename) or MimeType("application/octet-stream")
			return self_._mimetype