Skip to content

Commit

Permalink
Fixes in csv_bisect
Browse files Browse the repository at this point in the history
  • Loading branch information
insolor committed Sep 23, 2023
1 parent cc38bce commit 0fa9ab1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion df_translation_toolkit/csv_bisect/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from df_translation_toolkit.csv_bisect import csv_bisect

app = typer.Typer()
app.command(name="from_string_dump")(csv_bisect.main)
app.command(name="csv_bisect")(csv_bisect.main)
6 changes: 3 additions & 3 deletions df_translation_toolkit/csv_bisect/csv_bisect.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _bisect(start: int, end: int, bad: bool = False) -> bool:
if bad:
confirmed = True
else:
confirmed = input("Is it bad (Y/N)? ").upper() == "Y"
confirmed = input("Is it bad (y/n)? ").upper() == "y"

if not confirmed:
return False
Expand All @@ -41,7 +41,7 @@ def _bisect(start: int, end: int, bad: bool = False) -> bool:
print(f"Found string, line number {start+1}:")
print(data[start])

confirmed = input("Exclude from csv (Y/N)? ").upper() == "Y"
confirmed = input("Exclude from csv (y/n)? ").upper() == "y"
if confirmed:
csv_utils.write_csv(file_path, encoding, data[:start] + data[start + 1 :])

Expand All @@ -66,6 +66,6 @@ def main(csv_file: Path, encoding: str):
data = list(csv_utils.read_csv(backup_path, encoding))
bisect(csv_file, encoding, data)
finally:
confirmed = input("Restore from backup (Y/N)? ").upper() == "Y"
confirmed = input("Restore from backup (y/n)? ").upper() == "y"
if confirmed:
shutil.copy(backup_path, csv_file)

0 comments on commit 0fa9ab1

Please sign in to comment.