From b4ee9c761274f870e168140259c37071c6a2a49e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Haziza?= Date: Fri, 17 May 2024 17:51:41 +0200 Subject: [PATCH] Renaming the keyword argument --- crypt4gh/cli.py | 4 ++-- crypt4gh/lib.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crypt4gh/cli.py b/crypt4gh/cli.py index 1cef13d..325be55 100644 --- a/crypt4gh/cli.py +++ b/crypt4gh/cli.py @@ -151,11 +151,11 @@ def build_recipients(): try: if header: - header = open(header, 'wb') + header = open(header, 'wb') # let it raise exception lib.encrypt(recipient_keys, sys.stdin.buffer, sys.stdout.buffer, - header= header, + headerfile = header, offset = range_start, span = range_span) finally: diff --git a/crypt4gh/lib.py b/crypt4gh/lib.py index 6589a4b..fd24325 100644 --- a/crypt4gh/lib.py +++ b/crypt4gh/lib.py @@ -46,7 +46,7 @@ def _encrypt_segment(data, process, key): @close_on_broken_pipe -def encrypt(keys, infile, outfile, header_stream=None, offset=0, span=None): +def encrypt(keys, infile, outfile, headerfile=None, offset=0, span=None): '''Encrypt infile into outfile, using the list of keys. @@ -57,8 +57,8 @@ def encrypt(keys, infile, outfile, header_stream=None, offset=0, span=None): ''' LOG.info('Encrypting the file') - - header_stream = header_stream or outfile + + headerfile = headerfile or outfile # Forward to start position LOG.debug(" Start Coordinate: %s", offset) @@ -93,7 +93,7 @@ def encrypt(keys, infile, outfile, header_stream=None, offset=0, span=None): header_bytes = header.serialize(header_packets) LOG.debug('header length: %d', len(header_bytes)) - header_stream.write(header_bytes) + headerfile.write(header_bytes) # ...and cue music LOG.debug("Streaming content")