Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit ef4bca3

Browse files
fuzzy-replace fail and further funny fixes
1 parent 2acee46 commit ef4bca3

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

bak/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def bak_get(to_where_you_once_belonged):
102102
@click.argument("filename", required=True, type=click.Path(exists=True))
103103
def bak_diff(filename, using):
104104
commands.bak_diff_cmd(filename, command=using)
105-
105+
106106
@bak.command("list",
107107
help="List all .bakfiles, or a particular file's")
108108
@click.option("--relpaths",
@@ -115,7 +115,7 @@ def bak_diff(filename, using):
115115
required=False,
116116
type=click.Path(exists=True))
117117
def bak_list(relpaths, filename):
118-
commands.open_bak_list(filename=filename or None, relative_paths=relpaths)
118+
commands.show_bak_list(filename=filename or None, relative_paths=relpaths)
119119

120120
if __name__ == "__main__":
121121
bak()

bak/commands/__init__.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def get_choice():
121121
choice = get_choice()
122122
continue
123123
elif choice == "l":
124-
open_bak_list(bakfiles[0].orig_abspath)
124+
show_bak_list(bakfiles[0].orig_abspath)
125125
choice = get_choice()
126126
continue
127127
else:
@@ -142,7 +142,7 @@ def get_choice():
142142
get_choice()
143143

144144

145-
def open_bak_list(filename: (None, str, os.path) = None,
145+
def show_bak_list(filename: (None, str, os.path) = None,
146146
relative_paths: bool = False):
147147
""" Prints list of .bakfiles with metadata
148148
@@ -151,7 +151,7 @@ def open_bak_list(filename: (None, str, os.path) = None,
151151
List only `filename`'s .bakfiles
152152
"""
153153
# pass
154-
bakfiles: list[bakfile.BakFile]
154+
bakfiles: List[bakfile.BakFile]
155155
bakfiles = db_handler.get_bakfile_entries(filename) if filename else \
156156
db_handler.get_all_entries()
157157

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

229-
if old_bakfile is None:
229+
if old_bakfile == None:
230230
console.print("Cancelled.")
231231
return True
232232
elif not isinstance(old_bakfile, bakfile.BakFile):
@@ -275,8 +275,6 @@ def bak_down_cmd(filename: str,
275275
if confirm.lower()[0] != 'y':
276276
console.print("Cancelled.")
277277
return
278-
# os.remove(filename)
279-
# copy2(bakfile_entry.bakfile_loc, filename)
280278
if not keep_bakfile:
281279
os.rename(bakfile_entry.bakfile_loc, bakfile_entry.orig_abspath)
282280
for entry in bakfile_entries:

0 commit comments

Comments
 (0)