(mime_detected, type_detected)
| 245 | |
| 246 | |
| 247 | def _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 | |
| 259 | def detect_from_filename(filename): |
no outgoing calls
no test coverage detected
searching dependent graphs…