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

10
COPYING
View File

@ -1,8 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@ -646,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
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/>.
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.
@ -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,
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
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
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
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."
homepage: update_webmeta
# relase website
# release website
$(MAKE) -C doc/web release
tag:

View File

@ -57,7 +57,7 @@ patool repack linux-2.6.33.tar.gz linux-2.6.33.tar.bz2
Website
--------
See http://wummel.github.io/patool/ for more info and downloads.
See https://wummel.github.io/patool/ for more info and downloads.
API
----

View File

@ -3,7 +3,7 @@ Installation
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.
@ -21,7 +21,7 @@ Now install the application.
b) Installation as a normal user
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
``export PATH=$PATH:$HOME/bin`` to your shell configuration
file.

View File

@ -56,7 +56,7 @@ of helper applications. Can be given multiple times to increase
the output even more.
.TP
\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
overwriting files or ignoring password prompts could lead to unintended
consequences.
@ -72,7 +72,7 @@ The original archive will never be removed.
.IP "\(bu" 4
Files outside the output directory will never be created. This relies on
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
The following commands are available.
.SS extract
@ -138,7 +138,7 @@ not smaller, the archive is left unchanged.
.SS formats
\fBpatool\fP \fBformats\fP
.PP
Show all supported archive formats (ie. which helper applications
Show all supported archive formats (i.e. which helper applications
are available).
.SH HELP OPTION
Specifying the help option displays help for patool itself, or a

View File

@ -4,7 +4,7 @@ slug: index
---
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
programs. Tar, unzip, gzip - you name it and I forgot it.

2
patool
View File

@ -159,7 +159,7 @@ def create_argparser():
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('--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')
# extract
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:
raise util.PatoolError("unknown archive format `%s'" % format)
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):
@ -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)
if cmdlist:
# 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)
run_archive_cmdlist(cmdlist, verbosity=verbosity)
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)
if cmdlist:
# 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)
run_archive_cmdlist(cmdlist, verbosity=verbosity)
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)
if cmdlist:
# 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)
run_archive_cmdlist(cmdlist, verbosity=verbosity)
@ -620,7 +620,7 @@ def get_archive_cmdlist_func (program, command, format):
module = importlib.import_module(modulename, __name__)
except ImportError as 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:
archive_cmdlist_func = getattr(module, '%s_%s' % (command, format))
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."""
format, compression = get_archive_format(archive)
if compression:
# only recompress the compression itself (eg. for .tar.xz)
# only recompress the compression itself (e.g. for .tar.xz)
format = compression
tmpdir = util.tmpdir()
tmpdir2 = util.tmpdir()

View File

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

View File

@ -29,7 +29,7 @@ def extract_7z(archive, compression, cmd, verbosity, interactive, outdir, passwo
return cmdlist
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,
which would cause errors with patool repack."""
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
test_zpaq = list_zpaq

View File

@ -477,7 +477,7 @@ def tmpfile (dir=None, prefix="temp", suffix=None):
def shell_quote (value):
"""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':
return shell_quote_nt(value)
return "'%s'" % value.replace("'", r"'\''")
@ -670,7 +670,7 @@ def strlist_with_or (alist):
def is_same_file (filename1, filename2):
"""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
different paths to the same physical file.
"""

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2010-2016 Bastian Kleineidam
#
@ -53,7 +53,7 @@ def cnormpath (path):
release_ro = re.compile(r"\(released (.+)\)")
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")
release_date = "unknown"
with open(fname) as fd:
@ -209,7 +209,7 @@ installed.
maintainer = MyName,
maintainer_email = MyEmail,
license = "GPL",
url = "http://wummel.github.io/patool/",
url = "https://wummel.github.io/patool/",
packages = ['patoolib', 'patoolib.programs'],
data_files = data_files,
scripts = ['patool'],

View File

@ -46,7 +46,7 @@ class TestTar (ArchiveTest):
self.archive_commands('t.tar.lzma')
# 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('lzip')
def test_tar_lzip (self):
@ -88,7 +88,7 @@ class TestTar (ArchiveTest):
# self.archive_commands('t.tar.lzma.foo', format="tar", compression="lzma")
# 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('file')
@needs_codec(program, 'lzip')