Merge pull request #105 from a1346054/master

Minor cleanup
This commit is contained in:
Yaroslav Halchenko 2022-02-09 21:27:10 -05:00 committed by GitHub
commit 9dc8fab254
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 82 additions and 87 deletions

26
COPYING
View File

@ -1,12 +1,11 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
GNU GENERAL PUBLIC LICENSE Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
Preamble Preamble
The GNU General Public License is a free, copyleft license for The GNU General Public License is a free, copyleft license for
software and other kinds of works. software and other kinds of works.
@ -69,7 +68,7 @@ patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and The precise terms and conditions for copying, distribution and
modification follow. modification follow.
TERMS AND CONDITIONS TERMS AND CONDITIONS
0. Definitions. 0. Definitions.
@ -77,7 +76,7 @@ modification follow.
"Copyright" also means copyright-like laws that apply to other kinds of "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks. works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this "The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations. "recipients" may be individuals or organizations.
@ -510,7 +509,7 @@ actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid. country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties covered work, and grant a patent license to some of the parties
@ -619,9 +618,9 @@ an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee. copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it possible use to the public, the best way to achieve this is to make it
@ -646,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
@ -665,12 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school, You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary. if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>. <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>. <https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -45,7 +45,7 @@ update_webmeta:
git cm "Updated web meta data." git cm "Updated web meta data."
homepage: update_webmeta homepage: update_webmeta
# relase website # release website
$(MAKE) -C doc/web release $(MAKE) -C doc/web release
tag: tag:

View File

@ -8,15 +8,15 @@ searched, repacked and compared with patool. The advantage of patool is
its simplicity in handling archive files without having to remember a its simplicity in handling archive files without having to remember a
myriad of programs and options. myriad of programs and options.
The archive format is determined by the file(1) program and as The archive format is determined by the file(1) program and as
a fallback by the archive file extension. a fallback by the archive file extension.
patool supports 7z (.7z, .cb7), ACE (.ace, .cba), ADF (.adf), ALZIP (.alz), patool supports 7z (.7z, .cb7), ACE (.ace, .cba), ADF (.adf), ALZIP (.alz),
APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2), APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2),
CAB (.cab), COMPRESS (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms), CAB (.cab), COMPRESS (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms),
FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh), FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh),
LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar, .cbr), LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar, .cbr),
RZIP (.rz), SHN (.shn), TAR (.tar, .cbt), XZ (.xz), RZIP (.rz), SHN (.shn), TAR (.tar, .cbt), XZ (.xz),
ZIP (.zip, .jar, .cbz) and ZOO (.zoo) archive formats. ZIP (.zip, .jar, .cbz) and ZOO (.zoo) archive formats.
It relies on helper applications to handle those archive formats It relies on helper applications to handle those archive formats
(for example bzip2 for BZIP2 archives). (for example bzip2 for BZIP2 archives).
@ -57,7 +57,7 @@ patool repack linux-2.6.33.tar.gz linux-2.6.33.tar.bz2
Website Website
-------- --------
See http://wummel.github.io/patool/ for more info and downloads. See https://wummel.github.io/patool/ for more info and downloads.
API API
---- ----

View File

@ -33,23 +33,23 @@ General rules for all convenience functions:
The convenience functions are: The convenience functions are:
* ``def extract_archive(archive, verbosity=0, outdir=None, program=None)`` * ``def extract_archive(archive, verbosity=0, outdir=None, program=None)``
Extracts the given archive filename to the current working directory Extracts the given archive filename to the current working directory
or if specified to the given directory name in outdir. or if specified to the given directory name in outdir.
Checks that the archive exists and is readable before extracting it. Checks that the archive exists and is readable before extracting it.
* ``def list_archive(archive, verbosity=1, program=None)`` * ``def list_archive(archive, verbosity=1, program=None)``
Lists the contents of the given archive filename on stdout. Lists the contents of the given archive filename on stdout.
Checks that the archive exists and is readable before listing it. Checks that the archive exists and is readable before listing it.
* ``def test_archive(archive, verbosity=0, program=None)`` * ``def test_archive(archive, verbosity=0, program=None)``
Tests the given archive filename. Tests the given archive filename.
Checks that the archive exists and is readable before testing it. Checks that the archive exists and is readable before testing it.
* ``def create_archive(archive, filenames, verbosity=0, program=None)`` * ``def create_archive(archive, filenames, verbosity=0, program=None)``
Creates a new archive. The type of archive is determined Creates a new archive. The type of archive is determined
by the archive filename extension. by the archive filename extension.
Checks that the archive is not already existing to avoid overwriting it. Checks that the archive is not already existing to avoid overwriting it.
@ -57,7 +57,7 @@ The convenience functions are:
and are readable. and are readable.
* ``diff_archives(archive1, archive2, verbosity=0)`` * ``diff_archives(archive1, archive2, verbosity=0)``
This function lists differences in the content of the two archives. This function lists differences in the content of the two archives.
Both archives are extracted and the contents are compared Both archives are extracted and the contents are compared
recursively with the diff(1) program. recursively with the diff(1) program.
@ -70,7 +70,7 @@ The convenience functions are:
Checks that archive exists and is readable. Checks that archive exists and is readable.
* ``repack_archive (archive, archive_new, verbosity=0)`` * ``repack_archive (archive, archive_new, verbosity=0)``
This function extracts the contents of the archive and packs them This function extracts the contents of the archive and packs them
into archive_new. into archive_new.
Checks that archive exists and is readable. Also checks that Checks that archive exists and is readable. Also checks that

View File

@ -3,8 +3,8 @@ Installation
First, install the required software. First, install the required software.
1. Python >= 2.7 from http://www.python.org/ 1. Python >= 2.7 from https://www.python.org/
Now install the application. Now install the application.
@ -15,20 +15,20 @@ Now install the application.
2. Installation from source 2. Installation from source
a) Installation as root a) Installation as root
Run ``sudo python setup.py install`` to install patool. Run ``sudo python setup.py install`` to install patool.
b) Installation as a normal user b) Installation as a normal user
Run ``python setup.py install --home $HOME``. Note that you have Run ``python setup.py install --home $HOME``. Note that you have
to adjust your PATH and PYTHONPATH environment variables, eg. by to adjust your PATH and PYTHONPATH environment variables, e.g. by
adding the commands ``export PYTHONPATH=$HOME/lib/python`` and adding the commands ``export PYTHONPATH=$HOME/lib/python`` and
``export PATH=$PATH:$HOME/bin`` to your shell configuration ``export PATH=$PATH:$HOME/bin`` to your shell configuration
file. file.
For more information look at the `Modifying Python's search path`_ For more information look at the `Modifying Python's search path`_
documentation. documentation.
.. _Modifying Python's search path: .. _Modifying Python's search path:
http://docs.python.org/inst/search-path.html#SECTION000410000000000000000 http://docs.python.org/inst/search-path.html#SECTION000410000000000000000

View File

@ -56,7 +56,7 @@ of helper applications. Can be given multiple times to increase
the output even more. the output even more.
.TP .TP
\fB\-\-non\-interactive\fP \fB\-\-non\-interactive\fP
Try to prevent any interactive user input (ie. prompting for passwords Try to prevent any interactive user input (i.e. prompting for passwords
or for overwriting duplicate files). Use this option with care since or for overwriting duplicate files). Use this option with care since
overwriting files or ignoring password prompts could lead to unintended overwriting files or ignoring password prompts could lead to unintended
consequences. consequences.
@ -72,7 +72,7 @@ The original archive will never be removed.
.IP "\(bu" 4 .IP "\(bu" 4
Files outside the output directory will never be created. This relies on Files outside the output directory will never be created. This relies on
archive program options to prevent unpacking of files with an absolute archive program options to prevent unpacking of files with an absolute
path name (eg. \fB\-\-no\-absolute\-filenames\fP for \fBcpio(1)\fP). path name (e.g. \fB\-\-no\-absolute\-filenames\fP for \fBcpio(1)\fP).
.PP .PP
The following commands are available. The following commands are available.
.SS extract .SS extract
@ -138,7 +138,7 @@ not smaller, the archive is left unchanged.
.SS formats .SS formats
\fBpatool\fP \fBformats\fP \fBpatool\fP \fBformats\fP
.PP .PP
Show all supported archive formats (ie. which helper applications Show all supported archive formats (i.e. which helper applications
are available). are available).
.SH HELP OPTION .SH HELP OPTION
Specifying the help option displays help for patool itself, or a Specifying the help option displays help for patool itself, or a

View File

@ -4,7 +4,7 @@ slug: index
--- ---
Introduction Introduction
------------- -------------
[![XKCD Tar comic](http://imgs.xkcd.com/comics/tar.png)](http://xkcd.com/1168/) [![XKCD Tar comic](https://imgs.xkcd.com/comics/tar.png)](https://xkcd.com/1168/)
I could never remember the correct options for all those different compression I could never remember the correct options for all those different compression
programs. Tar, unzip, gzip - you name it and I forgot it. programs. Tar, unzip, gzip - you name it and I forgot it.

View File

@ -7,8 +7,8 @@ b, u, i, center,
dl, dt, dd, ol, ul, li, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td, table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup, figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary, menu, nav, output, ruby, section, summary,
time, mark, audio, video { time, mark, audio, video {
margin: 0; margin: 0;
@ -19,7 +19,7 @@ time, mark, audio, video {
vertical-align: baseline; vertical-align: baseline;
} }
/* HTML5 display-role reset for older browsers */ /* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section { footer, header, hgroup, menu, nav, section {
display: block; display: block;
} }
@ -43,7 +43,7 @@ table {
} }
body { body {
font-size: 13px; font-size: 13px;
line-height: 1.5; line-height: 1.5;
font-family: 'Helvetica Neue', Helvetica, Arial, serif; font-family: 'Helvetica Neue', Helvetica, Arial, serif;
color: #000; color: #000;
} }
@ -118,14 +118,14 @@ th {
td { td {
border: 1px solid #ebebeb; border: 1px solid #ebebeb;
text-align: center; text-align: center;
font-weight: 300; font-weight: 300;
} }
form { form {
background: #f2f2f2; background: #f2f2f2;
padding: 20px; padding: 20px;
} }
@ -133,43 +133,43 @@ form {
h1 { h1 {
font-size: 2.8em; font-size: 2.8em;
} }
h2 { h2 {
font-size: 22px; font-size: 22px;
font-weight: bold; font-weight: bold;
color: #303030; color: #303030;
margin-bottom: 8px; margin-bottom: 8px;
} }
h3 { h3 {
color: #d5000d; color: #d5000d;
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
margin-bottom: 8px; margin-bottom: 8px;
} }
h4 { h4 {
font-size: 16px; font-size: 16px;
color: #303030; color: #303030;
font-weight: bold; font-weight: bold;
} }
h5 { h5 {
font-size: 1em; font-size: 1em;
color: #303030; color: #303030;
} }
h6 { h6 {
font-size: .8em; font-size: .8em;
color: #303030; color: #303030;
} }
p { p {
font-weight: 300; font-weight: 300;
margin-bottom: 20px; margin-bottom: 20px;
} }
a { a {
text-decoration: none; text-decoration: none;
} }
@ -223,4 +223,4 @@ footer a {
.clearfix {display: inline-block;} .clearfix {display: inline-block;}
* html .clearfix {height: 1%;} * html .clearfix {height: 1%;}
.clearfix {display: block;} .clearfix {display: block;}

View File

@ -1,4 +1,4 @@
/* http://meyerweb.com/eric/tools/css/reset/ /* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126 v2.0 | 20110126
License: none (public domain) License: none (public domain)
*/ */
@ -11,8 +11,8 @@ b, u, i, center,
dl, dt, dd, ol, ul, li, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td, table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup, figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary, menu, nav, output, ruby, section, summary,
time, mark, audio, video { time, mark, audio, video {
margin: 0; margin: 0;
@ -23,7 +23,7 @@ time, mark, audio, video {
vertical-align: baseline; vertical-align: baseline;
} }
/* HTML5 display-role reset for older browsers */ /* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section { footer, header, hgroup, menu, nav, section {
display: block; display: block;
} }
@ -49,7 +49,7 @@ table {
/* LAYOUT STYLES */ /* LAYOUT STYLES */
body { body {
font-size: 1em; font-size: 1em;
line-height: 1.5; line-height: 1.5;
background: #e7e7e7 url(../images/body-bg.png) 0 0 repeat; background: #e7e7e7 url(../images/body-bg.png) 0 0 repeat;
font-family: 'Helvetica Neue', Helvetica, Arial, serif; font-family: 'Helvetica Neue', Helvetica, Arial, serif;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
@ -227,14 +227,14 @@ th {
td { td {
border: 1px solid #ebebeb; border: 1px solid #ebebeb;
text-align: center; text-align: center;
font-weight: 300; font-weight: 300;
} }
form { form {
background: #f2f2f2; background: #f2f2f2;
padding: 20px; padding: 20px;
} }
@ -242,43 +242,43 @@ form {
h1 { h1 {
font-size: 32px; font-size: 32px;
} }
h2 { h2 {
font-size: 22px; font-size: 22px;
font-weight: bold; font-weight: bold;
color: #303030; color: #303030;
margin-bottom: 8px; margin-bottom: 8px;
} }
h3 { h3 {
color: #d5000d; color: #d5000d;
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
margin-bottom: 8px; margin-bottom: 8px;
} }
h4 { h4 {
font-size: 16px; font-size: 16px;
color: #303030; color: #303030;
font-weight: bold; font-weight: bold;
} }
h5 { h5 {
font-size: 1em; font-size: 1em;
color: #303030; color: #303030;
} }
h6 { h6 {
font-size: .8em; font-size: .8em;
color: #303030; color: #303030;
} }
p { p {
font-weight: 300; font-weight: 300;
margin-bottom: 20px; margin-bottom: 20px;
} }
a { a {
text-decoration: none; text-decoration: none;
} }

2
patool
View File

@ -159,7 +159,7 @@ def create_argparser():
epilog=epilog, formatter_class=argparse.RawDescriptionHelpFormatter) epilog=epilog, formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('--verbose', '-v', action='count', default=0, dest='verbosity', help="verbose operation; can be given multiple times") parser.add_argument('--verbose', '-v', action='count', default=0, dest='verbosity', help="verbose operation; can be given multiple times")
parser.add_argument('--non-interactive', dest='interactive', default=True, action='store_false', parser.add_argument('--non-interactive', dest='interactive', default=True, action='store_false',
help="don't query for user input (ie. passwords or when overwriting duplicate files); use with care since overwriting files or ignoring passwords could be unintended") help="don't query for user input (i.e. passwords or when overwriting duplicate files); use with care since overwriting files or ignoring passwords could be unintended")
subparsers = parser.add_subparsers(help='the archive command; type "patool COMMAND -h" for command-specific help', dest='command') subparsers = parser.add_subparsers(help='the archive command; type "patool COMMAND -h" for command-specific help', dest='command')
# extract # extract
parser_extract = subparsers.add_parser('extract', help='extract one or more archives') parser_extract = subparsers.add_parser('extract', help='extract one or more archives')

View File

@ -361,7 +361,7 @@ def check_archive_format (format, compression):
if format not in ArchiveFormats: if format not in ArchiveFormats:
raise util.PatoolError("unknown archive format `%s'" % format) raise util.PatoolError("unknown archive format `%s'" % format)
if compression is not None and compression not in ArchiveCompressions: if compression is not None and compression not in ArchiveCompressions:
raise util.PatoolError("unkonwn archive compression `%s'" % compression) raise util.PatoolError("unknown archive compression `%s'" % compression)
def find_archive_program (format, command, program=None, password=None): def find_archive_program (format, command, program=None, password=None):
@ -546,7 +546,7 @@ def _extract_archive(archive, verbosity=0, interactive=True, outdir=None,
cmdlist = get_archive_cmdlist(archive, compression, program, verbosity, interactive, outdir, password=password) cmdlist = get_archive_cmdlist(archive, compression, program, verbosity, interactive, outdir, password=password)
if cmdlist: if cmdlist:
# an empty command list means the get_archive_cmdlist() function # an empty command list means the get_archive_cmdlist() function
# already handled the command (eg. when it's a builtin Python # already handled the command (e.g. when it's a builtin Python
# function) # function)
run_archive_cmdlist(cmdlist, verbosity=verbosity) run_archive_cmdlist(cmdlist, verbosity=verbosity)
if do_cleanup_outdir: if do_cleanup_outdir:
@ -583,7 +583,7 @@ def _create_archive(archive, filenames, verbosity=0, interactive=True,
cmdlist = get_archive_cmdlist(archive, compression, program, verbosity, interactive, filenames, password=password) cmdlist = get_archive_cmdlist(archive, compression, program, verbosity, interactive, filenames, password=password)
if cmdlist: if cmdlist:
# an empty command list means the get_archive_cmdlist() function # an empty command list means the get_archive_cmdlist() function
# already handled the command (eg. when it's a builtin Python # already handled the command (e.g. when it's a builtin Python
# function) # function)
run_archive_cmdlist(cmdlist, verbosity=verbosity) run_archive_cmdlist(cmdlist, verbosity=verbosity)
if origarchive: if origarchive:
@ -605,7 +605,7 @@ def _handle_archive(archive, command, verbosity=0, interactive=True,
cmdlist = get_archive_cmdlist(archive, compression, program, verbosity, interactive, password=password) cmdlist = get_archive_cmdlist(archive, compression, program, verbosity, interactive, password=password)
if cmdlist: if cmdlist:
# an empty command list means the get_archive_cmdlist() function # an empty command list means the get_archive_cmdlist() function
# already handled the command (eg. when it's a builtin Python # already handled the command (e.g. when it's a builtin Python
# function) # function)
run_archive_cmdlist(cmdlist, verbosity=verbosity) run_archive_cmdlist(cmdlist, verbosity=verbosity)
@ -620,7 +620,7 @@ def get_archive_cmdlist_func (program, command, format):
module = importlib.import_module(modulename, __name__) module = importlib.import_module(modulename, __name__)
except ImportError as msg: except ImportError as msg:
raise util.PatoolError(msg) raise util.PatoolError(msg)
# get archive handler function (eg. patoolib.programs.star.extract_tar) # get archive handler function (e.g. patoolib.programs.star.extract_tar)
try: try:
archive_cmdlist_func = getattr(module, '%s_%s' % (command, format)) archive_cmdlist_func = getattr(module, '%s_%s' % (command, format))
def check_for_password_before_cmdlist_func_call(*args, **kwargs): def check_for_password_before_cmdlist_func_call(*args, **kwargs):
@ -723,7 +723,7 @@ def _recompress_archive(archive, verbosity=0, interactive=True, password=None):
"""Try to recompress an archive to smaller size.""" """Try to recompress an archive to smaller size."""
format, compression = get_archive_format(archive) format, compression = get_archive_format(archive)
if compression: if compression:
# only recompress the compression itself (eg. for .tar.xz) # only recompress the compression itself (e.g. for .tar.xz)
format = compression format = compression
tmpdir = util.tmpdir() tmpdir = util.tmpdir()
tmpdir2 = util.tmpdir() tmpdir2 = util.tmpdir()

View File

@ -15,4 +15,3 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Archive commands for the bsdcpio program.""" """Archive commands for the bsdcpio program."""
from .cpio import extract_cpio, list_cpio, test_cpio, create_cpio from .cpio import extract_cpio, list_cpio, test_cpio, create_cpio

View File

@ -15,4 +15,3 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Archive commands for the lhasa program.""" """Archive commands for the lhasa program."""
from .lha import extract_lzh from .lha import extract_lzh

View File

@ -29,7 +29,7 @@ def extract_7z(archive, compression, cmd, verbosity, interactive, outdir, passwo
return cmdlist return cmdlist
def extract_7z_singlefile(archive, compression, cmd, verbosity, interactive, outdir, password=None): def extract_7z_singlefile(archive, compression, cmd, verbosity, interactive, outdir, password=None):
"""Extract a singlefile archive (eg. gzip or bzip2) with '7z e'. """Extract a singlefile archive (e.g. gzip or bzip2) with '7z e'.
This makes sure a single file and no subdirectories are created, This makes sure a single file and no subdirectories are created,
which would cause errors with patool repack.""" which would cause errors with patool repack."""
cmdlist = [cmd, 'e'] cmdlist = [cmd, 'e']

View File

@ -36,4 +36,3 @@ def create_zpaq(archive, compression, cmd, verbosity, interactive, filenames):
# zpaq has no separate test mode, so use listing instead # zpaq has no separate test mode, so use listing instead
test_zpaq = list_zpaq test_zpaq = list_zpaq

View File

@ -477,7 +477,7 @@ def tmpfile (dir=None, prefix="temp", suffix=None):
def shell_quote (value): def shell_quote (value):
"""Quote all shell metacharacters in given string value with strong """Quote all shell metacharacters in given string value with strong
(ie. single) quotes, handling the single quote especially.""" (i.e. single) quotes, handling the single quote especially."""
if os.name == 'nt': if os.name == 'nt':
return shell_quote_nt(value) return shell_quote_nt(value)
return "'%s'" % value.replace("'", r"'\''") return "'%s'" % value.replace("'", r"'\''")
@ -670,7 +670,7 @@ def strlist_with_or (alist):
def is_same_file (filename1, filename2): def is_same_file (filename1, filename2):
"""Check if filename1 and filename2 point to the same file object. """Check if filename1 and filename2 point to the same file object.
There can be false negatives, ie. the result is False, but it is There can be false negatives, i.e. the result is False, but it is
the same file anyway. Reason is that network filesystems can create the same file anyway. Reason is that network filesystems can create
different paths to the same physical file. different paths to the same physical file.
""" """

View File

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/env python
# -*- coding: iso-8859-1 -*- # -*- coding: iso-8859-1 -*-
# Copyright (C) 2010-2016 Bastian Kleineidam # Copyright (C) 2010-2016 Bastian Kleineidam
# #
@ -53,7 +53,7 @@ def cnormpath (path):
release_ro = re.compile(r"\(released (.+)\)") release_ro = re.compile(r"\(released (.+)\)")
def get_release_date (): def get_release_date ():
"""Parse and return relase date as string from doc/changelog.txt.""" """Parse and return release date as string from doc/changelog.txt."""
fname = os.path.join("doc", "changelog.txt") fname = os.path.join("doc", "changelog.txt")
release_date = "unknown" release_date = "unknown"
with open(fname) as fd: with open(fname) as fd:
@ -209,7 +209,7 @@ installed.
maintainer = MyName, maintainer = MyName,
maintainer_email = MyEmail, maintainer_email = MyEmail,
license = "GPL", license = "GPL",
url = "http://wummel.github.io/patool/", url = "https://wummel.github.io/patool/",
packages = ['patoolib', 'patoolib.programs'], packages = ['patoolib', 'patoolib.programs'],
data_files = data_files, data_files = data_files,
scripts = ['patool'], scripts = ['patool'],

View File

@ -46,7 +46,7 @@ class TestTar (ArchiveTest):
self.archive_commands('t.tar.lzma') self.archive_commands('t.tar.lzma')
# even though clzip would support extracting .lz files, the # even though clzip would support extracting .lz files, the
# file(1) --uncompress command does not use it for achive detection # file(1) --uncompress command does not use it for archive detection
@needs_program(program) @needs_program(program)
@needs_program('lzip') @needs_program('lzip')
def test_tar_lzip (self): def test_tar_lzip (self):
@ -88,7 +88,7 @@ class TestTar (ArchiveTest):
# self.archive_commands('t.tar.lzma.foo', format="tar", compression="lzma") # self.archive_commands('t.tar.lzma.foo', format="tar", compression="lzma")
# even though clzip would support extracting .lz files, the # even though clzip would support extracting .lz files, the
# file(1) --uncompress command does not use it for achive detection # file(1) --uncompress command does not use it for archive detection
@needs_program('lzip') @needs_program('lzip')
@needs_program('file') @needs_program('file')
@needs_codec(program, 'lzip') @needs_codec(program, 'lzip')