MCPcopy Index your code
hub / github.com/ahupp/python-magic / _create_filemagic

Function _create_filemagic

magic/compat.py:247–256  ·  view source on GitHub ↗
(mime_detected, type_detected)

Source from the content-addressed store, hash-verified

245
246
247def _create_filemagic(mime_detected, type_detected):
248 splat = mime_detected.split('; ')
249 mime_type = splat[0]
250 if len(splat) == 2:
251 mime_encoding = splat[1]
252 else:
253 mime_encoding = ''
254
255 return FileMagic(name=type_detected, mime_type=mime_type,
256 encoding=mime_encoding.replace('charset=', ''))
257
258
259def detect_from_filename(filename):

Callers 3

detect_from_filenameFunction · 0.85
detect_from_fobjFunction · 0.85
detect_from_contentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…