Handle *.apk as ZIP files.

This commit is contained in:
Bastian Kleineidam 2014-06-27 21:12:52 +02:00
parent cb73f5c958
commit 0c743e1248
6 changed files with 8 additions and 1 deletions

View File

@ -2,7 +2,7 @@
* Configure the xz program to also extract LZMA files.
* Fixed creation of LZMA files with the Python lzma module.
* Handle *.epub files as ZIP files.
* Handle *.epub and *.apk files as ZIP files.
1.6 (released 8.6.2014)

View File

@ -130,6 +130,7 @@ def add_mimedb_data(mimedb):
add_mimetype(mimedb, 'application/x-chm', '.chm')
add_mimetype(mimedb, 'application/x-iso9660-image', '.iso')
add_mimetype(mimedb, 'application/zip', '.epub')
add_mimetype(mimedb, 'application/zip', '.apk')
def add_mimetype(mimedb, mimetype, extension):

View File

@ -31,6 +31,8 @@ class TestUnzip (ArchiveTest):
self.archive_extract('t.epub', check=None)
self.archive_list('t.epub')
self.archive_test('t.epub')
self.archive_list('t.apk')
self.archive_test('t.apk')
@needs_program('file')
@needs_program(program)
@ -44,3 +46,5 @@ class TestUnzip (ArchiveTest):
self.archive_extract('t.epub.foo', check=None)
self.archive_list('t.epub.foo')
self.archive_test('t.epub.foo')
self.archive_list('t.apk.foo')
self.archive_test('t.apk.foo')

BIN
tests/data/t.apk Normal file

Binary file not shown.

BIN
tests/data/t.apk.foo Normal file

Binary file not shown.

View File

@ -125,6 +125,7 @@ class TestMime (unittest.TestCase):
self.mime_test_file("t.chm.foo", "application/x-chm")
self.mime_test_file("t.iso", "application/x-iso9660-image")
self.mime_test_file("t.epub", "application/zip")
self.mime_test_file("t.apk", "application/zip")
@needs_program('file')
@needs_program('lzip')
@ -200,3 +201,4 @@ class TestMime (unittest.TestCase):
self.mime_test_mimedb("t.chm", "application/x-chm")
self.mime_test_mimedb("t.iso", "application/x-iso9660-image")
self.mime_test_mimedb("t.epub", "application/zip")
self.mime_test_mimedb("t.apk", "application/zip")