Пример #1
0
def compDir():
    return lz4tools.compressTarDefault(res.input, outname=res.output)
Пример #2
0
def compDir():
    return lz4tools.compressTarDefault(**kwargs)
Пример #3
0
def compDir():
    return lz4tools.compressTarDefault(res.input, outname=res.output)
Пример #4
0
def compDir():
    return lz4tools.compressTarDefault(**kwargs)
Пример #5
0
 def test_1_write(self):
     lz4tools.compressTarDefault('src')
     self.assertTrue(os.path.exists('src.tar.lz4'))
Пример #6
0
parser.add_argument('output',
                    action='store',
                    nargs='?',
                    default=None,
                    help='Optional output target.')
if len(sys.argv) == 1:
    parser.print_help()
    sys.exit()
res = parser.parse_args()

#print('blockSizeId: {}'.format(res.blkSizeId))
prefs = lz4tools.lz4f.makePrefs(res.blkSizeId, res.blkMode)

compFile = lambda: lz4tools.compressFileDefault(
    res.input, outname=res.output, prefs=prefs)
compDir = lambda: lz4tools.compressTarDefault(
    res.input, outname=res.output, prefs=prefs)
decompFile = lambda: lz4tools.decompressFileDefault(res.input,
                                                    outname=res.output)
getInfo = lambda: lz4tools.getFileInfo(res.input)
outErr = lambda: sys.stdout.write(
    'Please specify only ony of the comp/decomp options')

if res.info:
    print(getInfo())
elif res.file:
    if res.tar or res.decomp:
        outErr()
    compFile()
elif res.tar:
    if res.decomp:
        outErr()
Пример #7
0
                    help=''.join(['Specify blkMode. 0 = Chained blocks. ',
                                  '1 = Independent blocks Default value is 0.']),
                    choices=[0, 1])
parser.add_argument('input', action='store', help='The targeted input.')
parser.add_argument('output', action='store', nargs='?', default=None,
                    help='Optional output target.')
if len(sys.argv) == 1:
    parser.print_help()
    sys.exit()
res = parser.parse_args()

#print('blockSizeId: {}'.format(res.blkSizeId))
prefs = lz4tools.lz4f.makePrefs(res.blkSizeId, res.blkMode)

compFile = lambda: lz4tools.compressFileDefault(res.input, outname=res.output, prefs=prefs)
compDir = lambda: lz4tools.compressTarDefault(res.input, outname=res.output, prefs=prefs)
decompFile = lambda: lz4tools.decompressFileDefault(res.input, outname=res.output)
getInfo = lambda: lz4tools.getFileInfo(res.input)
outErr = lambda: sys.stdout.write('Please specify only ony of the comp/decomp options')

if res.info:
    print(getInfo())
elif res.file:
    if res.tar or res.decomp:
        outErr()
    compFile()
elif res.tar:
    if res.decomp:
        outErr()
    compDir()
elif res.input.endswith('lz4'):
Пример #8
0
 def test_1_writeTar(self):
     lz4tools.compressTarDefault('src')
     self.assertTrue(os.path.exists('src.tar.lz4'))
Пример #9
0
def lz4composs(source_dir):
    lz4tools.compressTarDefault(source_dir)
    testTar = lz4tools.openTar(source_dir+'.tar.lz4')
    testTar.list()