skip file if have same file or passwd
This commit is contained in:
parent
4928f3fc50
commit
aa7776875b
|
@ -18,8 +18,34 @@
|
|||
7zr is a light executable supporting only the 7z archive format.
|
||||
"""
|
||||
|
||||
from .p7zip import \
|
||||
extract_7z, \
|
||||
list_7z, \
|
||||
test_7z, \
|
||||
create_7z
|
||||
#from .p7zip import \
|
||||
# extract_7z, \
|
||||
# list_7z, \
|
||||
# test_7z, \
|
||||
# create_7z
|
||||
from .p7zip import create_7z
|
||||
|
||||
def extract_7z(archive, compression, cmd, verbosity, interactive, outdir):
|
||||
"""Extract a 7z archive."""
|
||||
cmdlist = [cmd, 'x']
|
||||
if not interactive:
|
||||
cmdlist.append('-y')
|
||||
cmdlist.extend(['-o%s' % outdir, '--', archive])
|
||||
return cmdlist
|
||||
|
||||
def list_7z(archive, compression, cmd, verbosity, interactive):
|
||||
"""List a 7z archive."""
|
||||
cmdlist = [cmd, 'l']
|
||||
if not interactive:
|
||||
cmdlist.append('-y')
|
||||
cmdlist.extend(['--', archive])
|
||||
return cmdlist
|
||||
|
||||
def test_7z(archive, compression, cmd, verbosity, interactive):
|
||||
"""Test a 7z archive."""
|
||||
cmdlist = [cmd, 't']
|
||||
if not interactive:
|
||||
cmdlist.append('-y')
|
||||
cmdlist.extend(['--', archive])
|
||||
return cmdlist
|
||||
|
|
@ -23,7 +23,8 @@ def extract_7z(archive, compression, cmd, verbosity, interactive, outdir, passwo
|
|||
"""Extract a 7z archive."""
|
||||
cmdlist = [cmd, 'x']
|
||||
if not interactive:
|
||||
cmdlist.append('-y')
|
||||
#cmdlist.append('-y')
|
||||
cmdlist.extend(['-p-', '-y'])
|
||||
_maybe_add_password(cmdlist, password)
|
||||
cmdlist.extend(['-o%s' % outdir, '--', archive])
|
||||
return cmdlist
|
||||
|
@ -34,7 +35,8 @@ def extract_7z_singlefile(archive, compression, cmd, verbosity, interactive, out
|
|||
which would cause errors with patool repack."""
|
||||
cmdlist = [cmd, 'e']
|
||||
if not interactive:
|
||||
cmdlist.append('-y')
|
||||
#cmdlist.append('-y')
|
||||
cmdlist.extend(['-p-', '-y'])
|
||||
_maybe_add_password(cmdlist, password)
|
||||
cmdlist.extend(['-o%s' % outdir, '--', archive])
|
||||
return cmdlist
|
||||
|
@ -61,7 +63,8 @@ def list_7z (archive, compression, cmd, verbosity, interactive, password=None):
|
|||
"""List a 7z archive."""
|
||||
cmdlist = [cmd, 'l']
|
||||
if not interactive:
|
||||
cmdlist.append('-y')
|
||||
#cmdlist.append('-y')
|
||||
cmdlist.extend(['-p-', '-y'])
|
||||
_maybe_add_password(cmdlist, password)
|
||||
cmdlist.extend(['--', archive])
|
||||
return cmdlist
|
||||
|
@ -87,7 +90,8 @@ def test_7z (archive, compression, cmd, verbosity, interactive, password=None):
|
|||
"""Test a 7z archive."""
|
||||
cmdlist = [cmd, 't']
|
||||
if not interactive:
|
||||
cmdlist.append('-y')
|
||||
#cmdlist.append('-y')
|
||||
cmdlist.extend(['-p-', '-y'])
|
||||
_maybe_add_password(cmdlist, password)
|
||||
cmdlist.extend(['--', archive])
|
||||
return cmdlist
|
||||
|
|
Loading…
Reference in New Issue