Skip to content

Commit

Permalink
fuzzy-replace fail and further funny fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanceNCounter committed Jan 21, 2021
1 parent 2acee46 commit ef4bca3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions bak/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def bak_get(to_where_you_once_belonged):
@click.argument("filename", required=True, type=click.Path(exists=True))
def bak_diff(filename, using):
commands.bak_diff_cmd(filename, command=using)

@bak.command("list",
help="List all .bakfiles, or a particular file's")
@click.option("--relpaths",
Expand All @@ -115,7 +115,7 @@ def bak_diff(filename, using):
required=False,
type=click.Path(exists=True))
def bak_list(relpaths, filename):
commands.open_bak_list(filename=filename or None, relative_paths=relpaths)
commands.show_bak_list(filename=filename or None, relative_paths=relpaths)

if __name__ == "__main__":
bak()
10 changes: 4 additions & 6 deletions bak/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def get_choice():
choice = get_choice()
continue
elif choice == "l":
open_bak_list(bakfiles[0].orig_abspath)
show_bak_list(bakfiles[0].orig_abspath)
choice = get_choice()
continue
else:
Expand All @@ -142,7 +142,7 @@ def get_choice():
get_choice()


def open_bak_list(filename: (None, str, os.path) = None,
def show_bak_list(filename: (None, str, os.path) = None,
relative_paths: bool = False):
""" Prints list of .bakfiles with metadata
Expand All @@ -151,7 +151,7 @@ def open_bak_list(filename: (None, str, os.path) = None,
List only `filename`'s .bakfiles
"""
# pass
bakfiles: list[bakfile.BakFile]
bakfiles: List[bakfile.BakFile]
bakfiles = db_handler.get_bakfile_entries(filename) if filename else \
db_handler.get_all_entries()

Expand Down Expand Up @@ -226,7 +226,7 @@ def bak_up_cmd(filename: str):
select_prompt=(
("Enter a number to overwrite a .bakfile, or:\n(V)iew (L)ist (C)ancel", "C")))

if old_bakfile is None:
if old_bakfile == None:
console.print("Cancelled.")
return True
elif not isinstance(old_bakfile, bakfile.BakFile):
Expand Down Expand Up @@ -275,8 +275,6 @@ def bak_down_cmd(filename: str,
if confirm.lower()[0] != 'y':
console.print("Cancelled.")
return
# os.remove(filename)
# copy2(bakfile_entry.bakfile_loc, filename)
if not keep_bakfile:
os.rename(bakfile_entry.bakfile_loc, bakfile_entry.orig_abspath)
for entry in bakfile_entries:
Expand Down

0 comments on commit ef4bca3

Please sign in to comment.