From b8425504c4412a816b91e48f25fd6fa695231719 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Wed, 27 Feb 2013 19:38:07 +0100 Subject: [PATCH] Add ISO image support. --- doc/README.txt | 10 +- doc/changelog.txt | 1 + doc/patool.1 | 2 +- doc/patool.txt | 51 +++---- patoolib/__init__.py | 49 ++++--- patoolib/programs/genisoimage.py | 28 ++++ patoolib/programs/isoinfo.py | 21 +++ patoolib/programs/p7zip.py | 3 + setup.py | 2 +- tests/archives/__init__.py | 4 + tests/archives/test_7z.py | 6 + tests/archives/test_genisoimage.py | 27 ++++ tests/archives/test_isoinfo.py | 29 ++++ tests/data/t.iso | Bin 0 -> 376832 bytes tests/data/t.iso.foo | Bin 0 -> 376832 bytes tests/test_mime.py | 208 +++++++++++++++-------------- 16 files changed, 285 insertions(+), 156 deletions(-) create mode 100644 patoolib/programs/genisoimage.py create mode 100644 patoolib/programs/isoinfo.py create mode 100644 tests/archives/test_genisoimage.py create mode 100644 tests/archives/test_isoinfo.py create mode 100644 tests/data/t.iso create mode 100644 tests/data/t.iso.foo diff --git a/doc/README.txt b/doc/README.txt index 34b7e9d..dd17734 100644 --- a/doc/README.txt +++ b/doc/README.txt @@ -12,11 +12,11 @@ The archive format is determined by the file(1) program and as a fallback by the archive file extension. patool supports 7z (.7z), ACE (.ace), ADF (.adf), ALZIP (.alz), -APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2), CAB -(.cab), compress (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms), -FLAC (.flac), GZIP (.gz), LRZIP (.lrz), LZH (.lha, .lzh), LZIP -(.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar), RZIP -(.rz), SHN (.shn), TAR (.tar), XZ (.xz), ZIP (.zip, .jar) and +APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2), +CAB (.cab), compress (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms), +FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh), +LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar), +RZIP (.rz), SHN (.shn), TAR (.tar), XZ (.xz), ZIP (.zip, .jar) and ZOO (.zoo) formats. It relies on helper applications to handle those archive formats (for example bzip2 for BZIP2 archives). diff --git a/doc/changelog.txt b/doc/changelog.txt index 9ab1977..25129ac 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -1,6 +1,7 @@ 1.0 "" (released xx.xx.2013) * Add support for searching in archive contents. +* Add support for ISO image handling. * Allow multiple --verbose options to increase program output. * Fixed Python lzma archive handling. * Fixed lzop, lrzip and rzip archive handling. diff --git a/doc/patool.1 b/doc/patool.1 index fc270d5..43ec36a 100644 --- a/doc/patool.1 +++ b/doc/patool.1 @@ -27,7 +27,7 @@ by the archive file extension. \fBpatool\fP supports 7z (.7z), ACE (.ace), ADF (.adf), ALZIP (.alz), APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2), CAB (.cab), compress (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms), -FLAC (.flac), GZIP (.gz), LRZIP (.lrz), LZH (.lha, .lzh), LZIP (.lz), +FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh), LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar), RZIP (.rz), SHN (.shn), TAR (.tar), XZ (.xz), ZIP (.zip, .jar) and ZOO (.zoo) formats. It relies on helper applications to handle those archive formats diff --git a/doc/patool.txt b/doc/patool.txt index 6c5af3f..492170c 100644 --- a/doc/patool.txt +++ b/doc/patool.txt @@ -23,14 +23,15 @@ DESCRIPTION patool supports 7z (.7z), ACE (.ace), ADF (.adf), ALZIP (.alz), APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2), CAB (.cab), compress (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms), - FLAC (.flac), GZIP (.gz), LRZIP (.lrz), LZH (.lha, .lzh), LZIP - (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar), RZIP - (.rz), SHN (.shn), TAR (.tar), XZ (.xz), ZIP (.zip, .jar) and - ZOO (.zoo) formats. It relies on helper applications to handle - those archive formats (for example bzip2 for BZIP2 archives). + FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, + .lzh), LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR + (.rar), RZIP (.rz), SHN (.shn), TAR (.tar), XZ (.xz), ZIP + (.zip, .jar) and ZOO (.zoo) formats. It relies on helper + applications to handle those archive formats (for example bzip2 + for BZIP2 archives). - The archive formats TAR, ZIP, BZIP2 and GZIP are supported - natively and do not require helper applications to be + The archive formats TAR, ZIP, BZIP2 and GZIP are supported + natively and do not require helper applications to be installed. EXAMPLES @@ -44,7 +45,7 @@ EXAMPLES GLOBAL OPTIONS -v, --verbose - Display more info about what patool does, and display + Display more info about what patool does, and display the output of helper applications. Can be given multiple times to increase the output even more. @@ -55,7 +56,7 @@ COMMANDS · The original archive will never be removed. - · Files outside the outut directory will never be created. + · Files outside the outut directory will never be created. This relies on archive program options to prevent unpacking of files with an absolute path name (eg. --no-abso‐ lute-filenames for cpio(1)). @@ -65,22 +66,22 @@ COMMANDS extract patool extract [--outdir directory] ... - Extract files from given archives. The original archives will + Extract files from given archives. The original archives will never be removed and are left as is. --outdir directory - Extract to the given output directory. Default is to + Extract to the given output directory. Default is to extract to the current working directory. - If the archive contains exactly one file or directory, the ar‐ - chive contents are extracted directly to the output directory. + If the archive contains exactly one file or directory, the ar‐ + chive contents are extracted directly to the output directory. Else the files are extracted in a newly created subdirectory of - the output directory. The new directory is named after the ar‐ + the output directory. The new directory is named after the ar‐ chive filename without the extension. - This prevents cluttering the output directory with a lot of + This prevents cluttering the output directory with a lot of files from the extracted archive. - All extracted files are ensured that they are readable by the + All extracted files are ensured that they are readable by the current user. list @@ -91,15 +92,15 @@ COMMANDS create patool create ... - Create an archive from given files. All of the given files to - add to the archive must be readable by the current user. The - format of the archive to create is determined by the archive + Create an archive from given files. All of the given files to + add to the archive must be readable by the current user. The + format of the archive to create is determined by the archive file extension. test patool test ... - Test the given archives. If the helper application does not + Test the given archives. If the helper application does not support testing, the archive contents are listed instead. diff @@ -111,24 +112,24 @@ COMMANDS search patool search - Search in archive contents for given pattern using the grep(1) - program. The grep options used are -r; additional options can + Search in archive contents for given pattern using the grep(1) + program. The grep options used are -r; additional options can be supplied with the GREP_OPTIONS environment variable. repack patool repack - Repackage archive to a different format. The target archive + Repackage archive to a different format. The target archive format is determined by the file extension of archive_new. formats patool formats - Show all supported archive formats (ie. which helper applica‐ + Show all supported archive formats (ie. which helper applica‐ tions are available). HELP OPTION - Specifying the help option displays help for patool itself, or + Specifying the help option displays help for patool itself, or a command. For example: patool --help - display help for patool diff --git a/patoolib/__init__.py b/patoolib/__init__.py index 7e99f15..f96ac97 100644 --- a/patoolib/__init__.py +++ b/patoolib/__init__.py @@ -33,7 +33,7 @@ ArchiveCommands = ('list', 'extract', 'test', 'create') ArchiveFormats = ( '7z', 'ace', 'adf', 'alzip', 'ape', 'ar', 'arc', 'arj', 'bzip2', 'cab', 'chm', 'compress', 'cpio', 'deb', 'dms', - 'flac', 'gzip', 'lrzip', 'lzh', 'lzip', 'lzma', 'lzop', + 'flac', 'gzip', 'iso', 'lrzip', 'lzh', 'lzip', 'lzma', 'lzop', 'rar', 'rpm', 'rzip', 'shar', 'shn', 'tar', 'xz', 'zip', 'zoo') @@ -43,40 +43,41 @@ ArchiveCompressions = ('bzip2', 'compress', 'gzip', 'lzip', 'lzma', 'xz') # Map MIME types to archive format ArchiveMimetypes = { - 'application/x-adf': 'adf', - 'application/x-bzip2': 'bzip2', - 'application/x-tar': 'tar', - 'application/x-gzip': 'gzip', - 'application/zip': 'zip', - 'application/x-zip-compressed': 'zip', 'application/java-archive': 'zip', - 'application/x-7z-compressed': '7z', - 'application/x-compress': 'compress', - 'application/x-rar': 'rar', 'application/rar': 'rar', - 'application/x-cab': 'cab', 'application/vnd.ms-cab-compressed': 'cab', + 'application/x-7z-compressed': '7z', + 'application/x-ace': 'ace', + 'application/x-adf': 'adf', + 'application/x-alzip': 'alzip', + 'application/x-archive': 'ar', + 'application/x-arc': 'arc', 'application/x-arj': 'arj', + 'application/x-bzip2': 'bzip2', + 'application/x-cab': 'cab', 'application/x-chm': 'chm', + 'application/x-compress': 'compress', 'application/x-cpio': 'cpio', - 'application/x-redhat-package-manager': 'rpm', - 'application/x-rpm': 'rpm', 'application/x-debian-package': 'deb', + 'application/x-dms': 'dms', + 'application/x-gzip': 'gzip', + 'application/x-iso9660-image': 'iso', 'application/x-lzop': 'lzop', 'application/x-lzma': 'lzma', - 'application/x-xz': 'xz', 'application/x-lzip': 'lzip', - 'application/x-ace': 'ace', - 'application/x-archive': 'ar', 'application/x-lha': 'lzh', - 'application/x-lzh': 'lzh', - 'application/x-alzip': 'alzip', - 'application/x-arc': 'arc', 'application/x-lrzip': 'lrzip', + 'application/x-lzh': 'lzh', + 'application/x-rar': 'rar', + 'application/x-redhat-package-manager': 'rpm', + 'application/x-rpm': 'rpm', 'application/x-rzip': 'rzip', - 'application/x-zoo': 'zoo', - 'application/x-dms': 'dms', 'application/x-shar': 'shar', + 'application/x-tar': 'tar', + 'application/x-xz': 'xz', + 'application/x-zip-compressed': 'zip', + 'application/x-zoo': 'zoo', + 'application/zip': 'zip', 'audio/x-ape': 'ape', 'audio/x-shn': 'shn', 'audio/flac': 'flac', @@ -160,6 +161,12 @@ ArchivePrograms = { 'extract': ('py_gzip',), 'create': ('py_gzip',), }, + 'iso': { + 'extract': ('7z',), + 'list': ('7z', 'isoinfo'), + 'test': ('7z',), + 'create': ('genisoimage',), + }, 'lzh': { None: ('lha',), 'extract': ('lhasa',), diff --git a/patoolib/programs/genisoimage.py b/patoolib/programs/genisoimage.py new file mode 100644 index 0000000..9d91ef0 --- /dev/null +++ b/patoolib/programs/genisoimage.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013 Bastian Kleineidam +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +"""Archive commands for the genisoimage program.""" + +def create_iso (archive, compression, cmd, verbosity, filenames): + """Create an ISO archive.""" + # Use Joliet (-J) and Rock-Ridge (-r) format. + cmdlist = [cmd, '-r', '-J'] + if verbosity > 1: + cmdlist.append('-v') + if verbosity > 2: + cmdlist.append('-v') + cmdlist.extend(['-o', archive]) + cmdlist.extend(filenames) + return cmdlist diff --git a/patoolib/programs/isoinfo.py b/patoolib/programs/isoinfo.py new file mode 100644 index 0000000..c3e6010 --- /dev/null +++ b/patoolib/programs/isoinfo.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013 Bastian Kleineidam +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +"""Archive commands for the isoinfo program.""" + +def list_iso (archive, compression, cmd, verbosity): + """List an ISO archive.""" + # Use Joliet (-J) and Rock-Ridge (-R) options. + return [cmd, '-l', '-R', '-J', '-i', archive] diff --git a/patoolib/programs/p7zip.py b/patoolib/programs/p7zip.py index 7446299..e6bfadb 100644 --- a/patoolib/programs/p7zip.py +++ b/patoolib/programs/p7zip.py @@ -29,6 +29,7 @@ extract_bzip2 = \ extract_cpio = \ extract_rpm = \ extract_deb = \ + extract_iso = \ extract_7z def list_7z (archive, compression, cmd, verbosity): @@ -45,6 +46,7 @@ list_bzip2 = \ list_cpio = \ list_rpm = \ list_deb = \ + list_iso = \ list_7z @@ -62,6 +64,7 @@ test_bzip2 = \ test_cpio = \ test_rpm = \ test_deb = \ + test_iso = \ test_7z diff --git a/setup.py b/setup.py index 9c3227c..da25724 100644 --- a/setup.py +++ b/setup.py @@ -285,7 +285,7 @@ fallback by the archive file extension. patool supports 7z (.7z), ACE (.ace), ADF (.adf), ALZIP (.alz), APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2), CAB (.cab), compress (.Z), CPIO (.cpio), -DEB (.deb), DMS (.dms), FLAC (.flac), GZIP (.gz), LRZIP (.lrz), +DEB (.deb), DMS (.dms), FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh), LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar), RZIP (.rz), SHN (.shn), TAR (.tar), XZ (.xz), ZIP (.zip, .jar) and ZOO (.zoo) formats. diff --git a/tests/archives/__init__.py b/tests/archives/__init__.py index 11cb281..520bfa3 100644 --- a/tests/archives/__init__.py +++ b/tests/archives/__init__.py @@ -180,6 +180,8 @@ class ArchiveTest (unittest.TestCase): command = patoolib.list_archive elif self.program == 'lcab': program = 'cabextract' + elif self.program == 'genisoimage': + program = '7z' elif self.program == 'shar': return command(archive, program=program) @@ -200,6 +202,8 @@ class ArchiveTest (unittest.TestCase): program = 'cabextract' elif self.program == 'shar': program = 'unshar' + elif self.program == 'genisoimage': + program = '7z' tmpdir = patoolib.util.tmpdir(dir=basedir) try: olddir = patoolib.util.chdir(tmpdir) diff --git a/tests/archives/test_7z.py b/tests/archives/test_7z.py index a481fa2..6069180 100644 --- a/tests/archives/test_7z.py +++ b/tests/archives/test_7z.py @@ -33,6 +33,7 @@ class Test7z (ArchiveTest): self.archive_list('t.cpio') self.archive_list('t.rpm') self.archive_list('t.deb') + self.archive_list('t.iso') self.archive_extract('t.txt.gz', check=Content.Singlefile) self.archive_extract('t.txt.bz2', check=Content.Singlefile) self.archive_extract('t.jar', check=None) @@ -42,6 +43,7 @@ class Test7z (ArchiveTest): self.archive_extract('t.cpio') self.archive_extract('t.rpm', check=None) self.archive_extract('t.deb', check=None) + self.archive_extract('t.iso') self.archive_test('t.txt.gz') self.archive_test('t.txt.bz2') self.archive_test('t.jar') @@ -51,6 +53,7 @@ class Test7z (ArchiveTest): self.archive_test('t.cpio') self.archive_test('t.rpm') self.archive_test('t.deb') + self.archive_test('t.iso') @needs_codec(program, 'rar') def test_7z_rar (self): @@ -73,6 +76,7 @@ class Test7z (ArchiveTest): self.archive_list('t.cpio.foo') self.archive_list('t.rpm.foo') self.archive_list('t.deb.foo') + self.archive_list('t.iso.foo') self.archive_extract('t.txt.gz.foo', check=None) self.archive_extract('t.txt.bz2.foo', check=Content.Singlefile) self.archive_extract('t.jar.foo', check=None) @@ -82,6 +86,7 @@ class Test7z (ArchiveTest): self.archive_extract('t.cpio.foo') self.archive_extract('t.rpm.foo', check=None) self.archive_extract('t.deb.foo', check=None) + self.archive_extract('t.iso.foo') self.archive_test('t.txt.gz.foo') self.archive_test('t.txt.bz2.foo') self.archive_test('t.jar.foo') @@ -91,6 +96,7 @@ class Test7z (ArchiveTest): self.archive_test('t.cpio.foo') self.archive_test('t.rpm.foo') self.archive_test('t.deb.foo') + self.archive_test('t.iso.foo') @needs_program('file') @needs_codec(program, 'rar') diff --git a/tests/archives/test_genisoimage.py b/tests/archives/test_genisoimage.py new file mode 100644 index 0000000..66165be --- /dev/null +++ b/tests/archives/test_genisoimage.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013 Bastian Kleineidam +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +from . import ArchiveTest +from .. import needs_program + +class TestGenisoimage(ArchiveTest): + + program = 'genisoimage' + + # needs 7z for testing + @needs_program('7z') + @needs_program(program) + def test_genisoimage(self): + self.archive_create('t.iso') diff --git a/tests/archives/test_isoinfo.py b/tests/archives/test_isoinfo.py new file mode 100644 index 0000000..ce0e650 --- /dev/null +++ b/tests/archives/test_isoinfo.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013 Bastian Kleineidam +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +from . import ArchiveTest +from .. import needs_program + +class TestIsoinfo(ArchiveTest): + + program = 'isoinfo' + + @needs_program(program) + def test_isoinfo(self): + self.archive_list('t.iso') + + @needs_program(program) + def test_isoinfo_file(self): + self.archive_list('t.iso.foo') diff --git a/tests/data/t.iso b/tests/data/t.iso new file mode 100644 index 0000000000000000000000000000000000000000..f4379a9dfbba9b79f1b220d4f138221b77ce0776 GIT binary patch literal 376832 zcmeI*O>f*p7y#gLC^V`BrwUN%hg$`ym0+_;s#FoD#p@()H|v${pybqBPxOFPpSy@qQ$sn-D-<(p1kz>lx3EXU5Nt@~*v!9fAh|0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UA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&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U kAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly@Ky!>1jx?HzyJUM literal 0 HcmV?d00001 diff --git a/tests/data/t.iso.foo b/tests/data/t.iso.foo new file mode 100644 index 0000000000000000000000000000000000000000..f4379a9dfbba9b79f1b220d4f138221b77ce0776 GIT binary patch literal 376832 zcmeI*O>f*p7y#gLC^V`BrwUN%hg$`ym0+_;s#FoD#p@()H|v${pybqBPxOFPpSy@qQ$sn-D-<(p1kz>lx3EXU5Nt@~*v!9fAh|0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlykYxRCcP$BnVz_^hp8d%BRk?Te%jrz=*GXoY%u46e zB!r}WhUMjOee&}4Y1*!R+Ai*en{5(evfL)i;fJL!KJF%0mf8*5?Ng5n71+s#MO_wq zy`4ObnRIJ&v%9*xU8mc{Ag>SWCf`f5D(^LAmEO-Dq-$GS8)@D-Ecb^y{oWv-6+ZfU zz1!VPA9qH1ud2)8>f=tG?G}SLD|g0q+LzlpkJ301pA=2n`Ck(3Ae_}W^tWqnE(L-1PBly zK!5-N0t5&UxDbK%$UmL}h{-s2DciyK=wKyz-fIWcd;Y;>T+`%ukj?gu z&kR3%Wo#>q~bIQ;q_$w^|MpQvG&=~wf>X20gO*rOwU_PTA3`51`xMy zdp=IW_v33E#A>(BxT0{=_VUYc@1uAc2tt)Ifv{N0RjXFTt0!k zdYxQrev0Sci_z0~d-ksIzpm|Lvftck^nz zaXrejV!OzCO;HZhy4FfI7{;}|akHJv_x2bu0RjXF5Lk%7!}WzUt5E_32oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t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K!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U kAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly@Ky!>1jx?HzyJUM literal 0 HcmV?d00001 diff --git a/tests/test_mime.py b/tests/test_mime.py index 2d32ed4..dac40c1 100644 --- a/tests/test_mime.py +++ b/tests/test_mime.py @@ -33,47 +33,47 @@ class TestMime (unittest.TestCase): self.assertEqual(file_mime, mime, fail_msg % ("MIME type", filename, mime, file_mime)) self.assertEqual(file_encoding, encoding, fail_msg % ("Encoding", filename, encoding, file_encoding)) - def mime_test_file (self, filename, mime, encoding): + def mime_test_file (self, filename, mime, encoding=None): """Test that file has given mime and encoding as determined by file(1).""" self.mime_test(patoolib.util.guess_mime_file, filename, mime, encoding) - def mime_test_mimedb (self, filename, mime, encoding): + def mime_test_mimedb (self, filename, mime, encoding=None): """Test that file has given mime and encoding as determined by the mimetypes module.""" self.mime_test(patoolib.util.guess_mime_mimedb, filename, mime, encoding) @needs_program('file') def test_mime_file (self): - self.mime_test_file("t .7z", "application/x-7z-compressed", None) - self.mime_test_file("t.7z.foo", "application/x-7z-compressed", None) - self.mime_test_file("t.arj", "application/x-arj", None) - self.mime_test_file("t.arj.foo", "application/x-arj", None) - self.mime_test_file("t.txt.bz2", "application/x-bzip2", None) - self.mime_test_file("t.txt.bz2.foo", "application/x-bzip2", None) - self.mime_test_file("t.cab", "application/vnd.ms-cab-compressed", None) - self.mime_test_file("t.cab.foo", "application/vnd.ms-cab-compressed", None) - self.mime_test_file("t.cpio", "application/x-cpio", None) - self.mime_test_file("t.cpio.foo", "application/x-cpio", None) - self.mime_test_file("t.deb", "application/x-debian-package", None) - self.mime_test_file("t.deb.foo", "application/x-debian-package", None) - self.mime_test_file("t.txt.gz", "application/x-gzip", None) - self.mime_test_file("t.txt.gz.foo", "application/x-gzip", None) - self.mime_test_file("t.jar", "application/zip", None) - self.mime_test_file("t.jar.foo", "application/zip", None) + self.mime_test_file("t .7z", "application/x-7z-compressed") + self.mime_test_file("t.7z.foo", "application/x-7z-compressed") + self.mime_test_file("t.arj", "application/x-arj") + self.mime_test_file("t.arj.foo", "application/x-arj") + self.mime_test_file("t.txt.bz2", "application/x-bzip2") + self.mime_test_file("t.txt.bz2.foo", "application/x-bzip2") + self.mime_test_file("t.cab", "application/vnd.ms-cab-compressed") + self.mime_test_file("t.cab.foo", "application/vnd.ms-cab-compressed") + self.mime_test_file("t.cpio", "application/x-cpio") + self.mime_test_file("t.cpio.foo", "application/x-cpio") + self.mime_test_file("t.deb", "application/x-debian-package") + self.mime_test_file("t.deb.foo", "application/x-debian-package") + self.mime_test_file("t.txt.gz", "application/x-gzip") + self.mime_test_file("t.txt.gz.foo", "application/x-gzip") + self.mime_test_file("t.jar", "application/zip") + self.mime_test_file("t.jar.foo", "application/zip") # file(1) does not recognize .lzma files - #self.mime_test_file("t.lzma", "application/x-lzma", None) - #self.mime_test_file("t.lzma.foo", "application/x-lzma", None) - self.mime_test_file("t.txt.lz", "application/x-lzip", None) - self.mime_test_file("t.txt.lz.foo", "application/x-lzip", None) - self.mime_test_file("t.txt.lzo", "application/x-lzop", None) - self.mime_test_file("t.txt.lzo.foo", "application/x-lzop", None) - self.mime_test_file("t.rar", "application/x-rar", None) - self.mime_test_file("t.rar.foo", "application/x-rar", None) - self.mime_test_file("t.rpm", "application/x-rpm", None) - self.mime_test_file("t.rpm.foo", "application/x-rpm", None) - self.mime_test_file("t.tar", "application/x-tar", None) - self.mime_test_file("t.tar.foo", "application/x-tar", None) + #self.mime_test_file("t.lzma", "application/x-lzma") + #self.mime_test_file("t.lzma.foo", "application/x-lzma") + self.mime_test_file("t.txt.lz", "application/x-lzip") + self.mime_test_file("t.txt.lz.foo", "application/x-lzip") + self.mime_test_file("t.txt.lzo", "application/x-lzop") + self.mime_test_file("t.txt.lzo.foo", "application/x-lzop") + self.mime_test_file("t.rar", "application/x-rar") + self.mime_test_file("t.rar.foo", "application/x-rar") + self.mime_test_file("t.rpm", "application/x-rpm") + self.mime_test_file("t.rpm.foo", "application/x-rpm") + self.mime_test_file("t.tar", "application/x-tar") + self.mime_test_file("t.tar.foo", "application/x-tar") self.mime_test_file("t.tar.lz", "application/x-tar", "lzip") self.mime_test_file("t.tar.bz2", "application/x-tar", "bzip2") self.mime_test_file("t.tbz2", "application/x-tar", "bzip2") @@ -85,48 +85,49 @@ class TestMime (unittest.TestCase): # file(1) does not recognize .lzma files #self.mime_test_file("t.tar.lzma", "application/x-tar", "lzma") #self.mime_test_file("t.tar.lzma.foo", "application/x-tar", "lzma") - self.mime_test_file("t.txt.gz", "application/x-gzip", None) - self.mime_test_file("t.txt.gz.foo", "application/x-gzip", None) - self.mime_test_file("t.txt.xz", "application/x-xz", None) - self.mime_test_file("t.txt.xz.foo", "application/x-xz", None) - self.mime_test_file("t.txt.Z", "application/x-compress", None) - self.mime_test_file("t.txt.Z.foo", "application/x-compress", None) - self.mime_test_file("t.jar", "application/zip", None) - self.mime_test_file("t.jar.foo", "application/zip", None) - self.mime_test_file("t.zip", "application/zip", None) - self.mime_test_file("t.zip.foo", "application/zip", None) - self.mime_test_file("t.ace", "application/x-ace", None) - self.mime_test_file("t.ace.foo", "application/x-ace", None) - self.mime_test_file("t.txt.a", "application/x-archive", None) - self.mime_test_file("t.txt.a.foo", "application/x-archive", None) - self.mime_test_file("t.lha", "application/x-lha", None) - self.mime_test_file("t.lzh", "application/x-lha", None) - self.mime_test_file("t.lha.foo", "application/x-lha", None) + self.mime_test_file("t.txt.gz", "application/x-gzip") + self.mime_test_file("t.txt.gz.foo", "application/x-gzip") + self.mime_test_file("t.txt.xz", "application/x-xz") + self.mime_test_file("t.txt.xz.foo", "application/x-xz") + self.mime_test_file("t.txt.Z", "application/x-compress") + self.mime_test_file("t.txt.Z.foo", "application/x-compress") + self.mime_test_file("t.jar", "application/zip") + self.mime_test_file("t.jar.foo", "application/zip") + self.mime_test_file("t.zip", "application/zip") + self.mime_test_file("t.zip.foo", "application/zip") + self.mime_test_file("t.ace", "application/x-ace") + self.mime_test_file("t.ace.foo", "application/x-ace") + self.mime_test_file("t.txt.a", "application/x-archive") + self.mime_test_file("t.txt.a.foo", "application/x-archive") + self.mime_test_file("t.lha", "application/x-lha") + self.mime_test_file("t.lzh", "application/x-lha") + self.mime_test_file("t.lha.foo", "application/x-lha") # file(1) does not recognize .alz files - #self.mime_test_file("t.alz", "application/x-alzip", None) - #self.mime_test_file("t.alz.foo", "application/x-alzip", None) - self.mime_test_file("t.arc", "application/x-arc", None) - self.mime_test_file("t.arc.foo", "application/x-arc", None) + #self.mime_test_file("t.alz", "application/x-alzip") + #self.mime_test_file("t.alz.foo", "application/x-alzip") + self.mime_test_file("t.arc", "application/x-arc") + self.mime_test_file("t.arc.foo", "application/x-arc") # file(1) does not recognize .lrz files - #self.mime_test_file("t.txt.lrz", "application/x-lrzip", None) - #self.mime_test_file("t.txt.lrz.foo", "application/x-lrzip", None) - self.mime_test_file("t.txt.rz", "application/x-rzip", None) - self.mime_test_file("t.txt.rz.foo", "application/x-rzip", None) - self.mime_test_file("t.zoo", "application/x-zoo", None) - self.mime_test_file("t.zoo.foo", "application/x-zoo", None) - self.mime_test_file("t.dms", "application/x-dms", None) - self.mime_test_file("t.dms.foo", "application/x-dms", None) - self.mime_test_file("t.ape", "audio/x-ape", None) - self.mime_test_file("t.ape.foo", "audio/x-ape", None) + #self.mime_test_file("t.txt.lrz", "application/x-lrzip") + #self.mime_test_file("t.txt.lrz.foo", "application/x-lrzip") + self.mime_test_file("t.txt.rz", "application/x-rzip") + self.mime_test_file("t.txt.rz.foo", "application/x-rzip") + self.mime_test_file("t.zoo", "application/x-zoo") + self.mime_test_file("t.zoo.foo", "application/x-zoo") + self.mime_test_file("t.dms", "application/x-dms") + self.mime_test_file("t.dms.foo", "application/x-dms") + self.mime_test_file("t.ape", "audio/x-ape") + self.mime_test_file("t.ape.foo", "audio/x-ape") # file(1) does not recognize .shn files - #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.flac", "audio/flac", None) - self.mime_test_file("t.flac.foo", "audio/flac", None) - self.mime_test_file("t.adf", "application/x-adf", None) - self.mime_test_file("t.adf.foo", "application/x-adf", None) - self.mime_test_file("t.chm", "application/x-chm", None) - self.mime_test_file("t.chm.foo", "application/x-chm", None) + #self.mime_test_file("t.shn", "audio/x-shn") + #self.mime_test_file("t.shn.foo", "audio/x-shn") + self.mime_test_file("t.flac", "audio/flac") + self.mime_test_file("t.flac.foo", "audio/flac") + self.mime_test_file("t.adf", "application/x-adf") + self.mime_test_file("t.adf.foo", "application/x-adf") + self.mime_test_file("t.chm", "application/x-chm") + self.mime_test_file("t.chm.foo", "application/x-chm") + self.mime_test_file("t.iso", "application/x-iso9660-image") @needs_program('file') @needs_program('lzip') @@ -157,20 +158,20 @@ class TestMime (unittest.TestCase): self.mime_test_file("t.tar.Z.foo", "application/x-tar", "compress") def test_mime_mimedb (self): - self.mime_test_mimedb("t .7z", "application/x-7z-compressed", None) - self.mime_test_mimedb("t.arj", "application/x-arj", None) - self.mime_test_mimedb("t .bz2", "application/x-bzip2", None) - self.mime_test_mimedb("t.cab", "application/x-cab", None) - self.mime_test_mimedb("t.cpio", "application/x-cpio", None) - self.mime_test_mimedb("t.deb", "application/x-debian-package", None) - self.mime_test_mimedb("t.gz", "application/x-gzip", None) - self.mime_test_mimedb("t.jar", "application/java-archive", None) - self.mime_test_mimedb("t.lzma", "application/x-lzma", None) - self.mime_test_mimedb("t.txt.lz", "application/x-lzip", None) - self.mime_test_mimedb("t.lzo", "application/x-lzop", None) - self.mime_test_mimedb("t.rar", ("application/rar", "application/x-rar"), None) - self.mime_test_mimedb("t.rpm", ("application/x-redhat-package-manager", "application/x-rpm"), None) - self.mime_test_mimedb("t.tar", "application/x-tar", None) + self.mime_test_mimedb("t .7z", "application/x-7z-compressed") + self.mime_test_mimedb("t.arj", "application/x-arj") + self.mime_test_mimedb("t .bz2", "application/x-bzip2") + self.mime_test_mimedb("t.cab", "application/x-cab") + self.mime_test_mimedb("t.cpio", "application/x-cpio") + self.mime_test_mimedb("t.deb", "application/x-debian-package") + self.mime_test_mimedb("t.gz", "application/x-gzip") + self.mime_test_mimedb("t.jar", "application/java-archive") + self.mime_test_mimedb("t.lzma", "application/x-lzma") + self.mime_test_mimedb("t.txt.lz", "application/x-lzip") + self.mime_test_mimedb("t.lzo", "application/x-lzop") + self.mime_test_mimedb("t.rar", ("application/rar", "application/x-rar")) + self.mime_test_mimedb("t.rpm", ("application/x-redhat-package-manager", "application/x-rpm")) + self.mime_test_mimedb("t.tar", "application/x-tar") self.mime_test_mimedb("t.tar.bz2", "application/x-tar", "bzip2") self.mime_test_mimedb("t.tar.gz", "application/x-tar", "gzip") self.mime_test_mimedb("t.tar.lzma", "application/x-tar", "lzma") @@ -180,23 +181,24 @@ class TestMime (unittest.TestCase): self.mime_test_mimedb("t.taz", "application/x-tar", "gzip") self.mime_test_mimedb("t.tbz2", "application/x-tar", "bzip2") self.mime_test_mimedb("t.tgz", "application/x-tar", "gzip") - self.mime_test_mimedb("t.txt.gz", "application/x-gzip", None) - self.mime_test_mimedb("t .xz", "application/x-xz", None) - self.mime_test_mimedb("t.Z", "application/x-compress", None) - self.mime_test_mimedb("t.zip", ("application/zip", "application/x-zip-compressed"), None) - self.mime_test_mimedb("t.ace", "application/x-ace", None) - self.mime_test_mimedb("t.a", "application/x-archive", None) - self.mime_test_mimedb("t.lha", "application/x-lha", None) - self.mime_test_mimedb("t.lzh", "application/x-lzh", None) - self.mime_test_mimedb("t.alz", "application/x-alzip", None) - self.mime_test_mimedb("t.arc", "application/x-arc", None) - self.mime_test_mimedb("t.lrz", "application/x-lrzip", None) - self.mime_test_mimedb("t.rz", "application/x-rzip", None) - self.mime_test_mimedb("t.zoo", "application/x-zoo", None) - self.mime_test_mimedb("t.dms", "application/x-dms", None) - self.mime_test_mimedb("t.shar", "application/x-shar", 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.flac", "audio/flac", None) - self.mime_test_mimedb("t.adf", "application/x-adf", None) - self.mime_test_mimedb("t.chm", "application/x-chm", None) + self.mime_test_mimedb("t.txt.gz", "application/x-gzip") + self.mime_test_mimedb("t .xz", "application/x-xz") + self.mime_test_mimedb("t.Z", "application/x-compress") + self.mime_test_mimedb("t.zip", ("application/zip", "application/x-zip-compressed")) + self.mime_test_mimedb("t.ace", "application/x-ace") + self.mime_test_mimedb("t.a", "application/x-archive") + self.mime_test_mimedb("t.lha", "application/x-lha") + self.mime_test_mimedb("t.lzh", "application/x-lzh") + self.mime_test_mimedb("t.alz", "application/x-alzip") + self.mime_test_mimedb("t.arc", "application/x-arc") + self.mime_test_mimedb("t.lrz", "application/x-lrzip") + self.mime_test_mimedb("t.rz", "application/x-rzip") + self.mime_test_mimedb("t.zoo", "application/x-zoo") + self.mime_test_mimedb("t.dms", "application/x-dms") + self.mime_test_mimedb("t.shar", "application/x-shar") + self.mime_test_mimedb("t.ape", "audio/x-ape") + self.mime_test_mimedb("t.shn", "audio/x-shn") + self.mime_test_mimedb("t.flac", "audio/flac") + self.mime_test_mimedb("t.adf", "application/x-adf") + self.mime_test_mimedb("t.chm", "application/x-chm") + self.mime_test_mimedb("t.iso", "application/x-iso9660-image")