Add flac file detection.
This commit is contained in:
parent
de18ff9ca3
commit
52762df5c6
|
@ -23,7 +23,7 @@ ArchiveCommands = ('list', 'extract', 'test', 'create')
|
||||||
|
|
||||||
# Supported archive formats
|
# Supported archive formats
|
||||||
ArchiveFormats = ('7z', 'ace', 'alzip', 'ape', 'ar', 'arc', 'arj', 'bzip2',
|
ArchiveFormats = ('7z', 'ace', 'alzip', 'ape', 'ar', 'arc', 'arj', 'bzip2',
|
||||||
'cab', 'compress', 'cpio', 'deb', 'dms', 'gzip', 'lrzip', 'lzh',
|
'cab', 'compress', 'cpio', 'deb', 'dms', 'flac', 'gzip', 'lrzip', 'lzh',
|
||||||
'lzip', 'lzma', 'lzop', 'rar', 'rpm', 'rzip', 'shn', 'tar', 'xz',
|
'lzip', 'lzma', 'lzop', 'rar', 'rpm', 'rzip', 'shn', 'tar', 'xz',
|
||||||
'zip', 'zoo')
|
'zip', 'zoo')
|
||||||
|
|
||||||
|
@ -66,6 +66,7 @@ ArchiveMimetypes = {
|
||||||
'application/x-dms': 'dms',
|
'application/x-dms': 'dms',
|
||||||
'audio/x-ape': 'ape',
|
'audio/x-ape': 'ape',
|
||||||
'audio/x-shn': 'shn',
|
'audio/x-shn': 'shn',
|
||||||
|
'audio/flac': 'flac',
|
||||||
}
|
}
|
||||||
|
|
||||||
# List of programs supporting the given archive format and command.
|
# List of programs supporting the given archive format and command.
|
||||||
|
@ -104,6 +105,8 @@ ArchivePrograms = {
|
||||||
'create': ('pbzip2', 'lbzip2', 'bzip2', 'py_bz2'),
|
'create': ('pbzip2', 'lbzip2', 'bzip2', 'py_bz2'),
|
||||||
'list': ('py_echo',),
|
'list': ('py_echo',),
|
||||||
},
|
},
|
||||||
|
'flac': {
|
||||||
|
},
|
||||||
'tar': {
|
'tar': {
|
||||||
None: ('tar', 'star', 'py_tarfile'),
|
None: ('tar', 'star', 'py_tarfile'),
|
||||||
},
|
},
|
||||||
|
|
|
@ -246,6 +246,7 @@ FileText2Mime = {
|
||||||
"Zoo archive data": "application/x-zoo",
|
"Zoo archive data": "application/x-zoo",
|
||||||
"DMS archive data": "application/x-dms",
|
"DMS archive data": "application/x-dms",
|
||||||
"Monkey's Audio": "audio/x-ape",
|
"Monkey's Audio": "audio/x-ape",
|
||||||
|
"FLAC audio bitstream data": "audio/flac",
|
||||||
}
|
}
|
||||||
|
|
||||||
def guess_mime_file_text (file_prog, filename):
|
def guess_mime_file_text (file_prog, filename):
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -121,6 +121,8 @@ class TestMime (unittest.TestCase):
|
||||||
# file(1) does not recognize .shn files
|
# file(1) does not recognize .shn files
|
||||||
#self.mime_test_file("t.shn", "audio/x-shn", None)
|
#self.mime_test_file("t.shn", "audio/x-shn", None)
|
||||||
#self.mime_test_file("t.shn.foo", "audio/x-shn", None)
|
#self.mime_test_file("t.shn.foo", "audio/x-shn", None)
|
||||||
|
self.mime_test_file("t.flac", "audio/flac", None)
|
||||||
|
self.mime_test_file("t.flac.foo", "audio/flac", None)
|
||||||
|
|
||||||
@needs_program('file')
|
@needs_program('file')
|
||||||
@needs_program('lzip')
|
@needs_program('lzip')
|
||||||
|
@ -190,3 +192,4 @@ class TestMime (unittest.TestCase):
|
||||||
self.mime_test_mimedb("t.dms", "application/x-dms", None)
|
self.mime_test_mimedb("t.dms", "application/x-dms", None)
|
||||||
self.mime_test_mimedb("t.ape", "audio/x-ape", None)
|
self.mime_test_mimedb("t.ape", "audio/x-ape", None)
|
||||||
self.mime_test_mimedb("t.shn", "audio/x-shn", None)
|
self.mime_test_mimedb("t.shn", "audio/x-shn", None)
|
||||||
|
self.mime_test_mimedb("t.flac", "audio/flac", None)
|
||||||
|
|
Loading…
Reference in New Issue