Skip to content

Commit 1d272a6

Browse files
committed
Remove --text flag from cat utility
1 parent 76e8c34 commit 1d272a6

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

micall/drivers/sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ def run_denovo(self, excluded_seeds):
435435
concatenate_files(inputs=[self.unstitched_contigs_fasta,
436436
self.merged_contigs_fasta],
437437
output=self.combined_contigs_fasta,
438-
text=True, ignore_not_found=True)
438+
ignore_not_found=True)
439439

440440
with open(self.combined_contigs_fasta, 'r') as combined_contigs_fasta, \
441441
open(self.stitched_contigs_fasta, 'w') as stitched_contigs_fasta:

micall/utils/cat.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
def cat(inputs: Iterable[Path],
2323
output: Path,
24-
text: bool,
2524
ignore_not_found: bool,
2625
) -> int:
2726

@@ -33,7 +32,6 @@ def cat(inputs: Iterable[Path],
3332
inputs (Paths): List of input file paths.
3433
output (Path): Path to the output file where the result
3534
will be saved.
36-
text (bool): Whether to treat inputs as text.
3735
ignore_not_found (bool): Whether to treat non-existant inputs as empty.
3836
"""
3937

@@ -42,11 +40,7 @@ def cat(inputs: Iterable[Path],
4240
for file in inputs:
4341
try:
4442
with open(file) as f:
45-
if text:
46-
for line in f:
47-
out.write(line)
48-
else:
49-
shutil.copyfileobj(f, out)
43+
shutil.copyfileobj(f, out)
5044
except FileNotFoundError:
5145
if ignore_not_found:
5246
continue
@@ -71,8 +65,6 @@ def main(argv: Sequence[str]) -> int:
7165
parser = argparse.ArgumentParser(
7266
description="Concatenate inputs and write to an output file.")
7367

74-
parser.add_argument('--text', action='store_true',
75-
help='Operate on text inputs.')
7668
parser.add_argument('--ignore-not-found', action='store_true',
7769
help='Treat non-existant inputs as empty.')
7870

0 commit comments

Comments
 (0)