From 54a2c5f8f8f71359ee62143f580e8a0f89e9421a Mon Sep 17 00:00:00 2001 From: Raphael Roberts Date: Fri, 7 May 2021 15:43:59 -0500 Subject: [PATCH] Changed backup_filepath to property_file --- tibi_hardlinks/backups.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tibi_hardlinks/backups.py b/tibi_hardlinks/backups.py index cee256b..39dbf44 100644 --- a/tibi_hardlinks/backups.py +++ b/tibi_hardlinks/backups.py @@ -33,9 +33,9 @@ def create_backup_directory_name(backup_info, time_format="%Y-%m-%d_%H-%M-%S"): return backup_directory_name -def find_backup_data(backup_filepath: Path, backup_info): - # find the path of the *.apk, *.properties, and *.tar(.gz) corresponding to backup_filepath - backup_root = backup_filepath.parent +def find_backup_data(property_file: Path, backup_info): + # find the path of the *.apk, *.properties, and *.tar(.gz) corresponding to property_file + backup_root = property_file.parent try: apk_hash = backup_info["app_apk_md5"] apk_file = filter( @@ -43,7 +43,7 @@ def find_backup_data(backup_filepath: Path, backup_info): ) except KeyError: apk_file = None - related_files = list(backup_root.glob(backup_filepath.stem + "*")) + related_files = list(backup_root.glob(property_file.stem + "*")) if len(related_files) > 2: raise Exception tar_file = None @@ -51,7 +51,7 @@ def find_backup_data(backup_filepath: Path, backup_info): if ".tar" in filename.name: tar_file = filename - property_file = backup_filepath + property_file = property_file return {"property_file": property_file, "apk_file": apk_file, "tar_file": tar_file} @@ -59,7 +59,7 @@ class Backup: def __init__(self, property_file: Path): self.property_file = property_file self.backup_info = read_backup_properties(property_file) - self.related_files = find_backup_data(self.backup_filepath, self.backup_info) + self.related_files = find_backup_data(self.property_file, self.backup_info) def hardlink_to(self, dest): for filepath in self.related_files.values():