diff --git a/bak/__main__.py b/bak/__main__.py index 00d4024..d6009ac 100644 --- a/bak/__main__.py +++ b/bak/__main__.py @@ -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", @@ -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() diff --git a/bak/commands/__init__.py b/bak/commands/__init__.py index eade211..6d24f01 100644 --- a/bak/commands/__init__.py +++ b/bak/commands/__init__.py @@ -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: @@ -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 @@ -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() @@ -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): @@ -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: