Added support for libchm-bin.

This commit is contained in:
Bastian Kleineidam 2012-11-19 22:39:50 +01:00
parent eaf3aab677
commit 092245d440
4 changed files with 55 additions and 2 deletions

View File

@ -3,7 +3,7 @@
* Fixed unadf archive listing. * Fixed unadf archive listing.
* Added support for Python 3.x. * Added support for Python 3.x.
* Use importlib to find program modules and depend on Python >= 2.7. * Use importlib to find program modules and depend on Python >= 2.7.
* Added support for archmage handling CHM (.chm) archives. * Added support for archmage and chmlib handling CHM (.chm) archives.
0.17 "I am Bruce Lee" (released 4.8.2012) 0.17 "I am Bruce Lee" (released 4.8.2012)

View File

@ -126,7 +126,7 @@ ArchivePrograms = {
'test': ('cabextract', '7z'), 'test': ('cabextract', '7z'),
}, },
'chm': { 'chm': {
'extract': ('archmage',), 'extract': ('archmage', 'extract_chmLib'),
'test': ('archmage',), 'test': ('archmage',),
}, },
'flac': { 'flac': {
@ -247,6 +247,7 @@ ProgramModules = {
'7za': 'p7azip', '7za': 'p7azip',
'uncompress.real': 'uncompress', 'uncompress.real': 'uncompress',
'dpkg-deb': 'dpkg', 'dpkg-deb': 'dpkg',
'extract_chmlib': 'chmlib',
} }

View File

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
"""Archive commands for the chmlib programs."""
import os
def extract_chm (archive, compression, cmd, **kwargs):
"""Extract a CHM archive."""
return [cmd, os.path.abspath(archive), kwargs['outdir']]

View File

@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
from . import ArchiveTest
from .. import needs_program
class TestChmlib (ArchiveTest):
program = 'extract_chmLib'
@needs_program(program)
def test_archmage (self):
self.archive_extract('t.chm', check=None)
@needs_program('file')
@needs_program(program)
def test_archmage_file (self):
self.archive_extract('t.chm.foo', check=None)