@@ -137,7 +137,9 @@ def get_backup_path(self, backup_name, file_name) -> str:
137137 str: Full path of the corresponding file in the backup.
138138
139139 """
140- return os .path .realpath (os .path .join (self .backups_path , backup_name , self .BACKUP_ROOT , self .get_file_key (file_name )))
140+ return os .path .realpath (
141+ os .path .join (self .backups_path , backup_name , self .BACKUP_ROOT , self .get_file_key (file_name ))
142+ )
141143
142144 def get_file_key (self , file_name ):
143145 file_comp = io_util .get_path_components (self .data_root , file_name ) + [os .path .basename (file_name )]
@@ -183,7 +185,9 @@ def _get_backups(self):
183185 raise HedFileError ("BadBackupPath" , f"{ backup_root } is not a backup directory." , "" )
184186 if len (os .listdir (backup_root )) != 2 :
185187 raise HedFileError (
186- "BadBackupFormat" , f"Backup { backup_root } must only contain backup_root and backup_lock.json file." , ""
188+ "BadBackupFormat" ,
189+ f"Backup { backup_root } must only contain backup_root and backup_lock.json file." ,
190+ "" ,
187191 )
188192 backup_dict , files_not_in_backup , backups_not_in_directory = self ._check_backup_consistency (backup )
189193 if files_not_in_backup :
@@ -216,19 +220,21 @@ def _check_backup_consistency(self, backup_name):
216220 if not os .path .exists (backup_dict_path ):
217221 raise HedFileError (
218222 "BadBackupDictionaryPath" ,
219- f"Backup dictionary path { backup_dict_path } for backup " f" { backup_name } does not exist so backup invalid" ,
223+ f"Backup dictionary path { backup_dict_path } for backup { backup_name } does not exist so backup invalid" ,
220224 "" ,
221225 )
222226 backup_root_path = os .path .realpath (os .path .join (self .backups_path , backup_name , self .BACKUP_ROOT ))
223227 if not os .path .isdir (backup_root_path ):
224228 raise HedFileError (
225229 "BadBackupRootPath" ,
226- f"Backup root path { backup_root_path } for { backup_name } " f" does not exist so backup invalid" ,
230+ f"Backup root path { backup_root_path } for { backup_name } does not exist so backup invalid" ,
227231 "" ,
228232 )
229233 with open (backup_dict_path , "r" ) as fp :
230234 backup_dict = json .load (fp )
231- backup_paths = {os .path .realpath (os .path .join (backup_root_path , backup_key )) for backup_key in backup_dict .keys ()}
235+ backup_paths = {
236+ os .path .realpath (os .path .join (backup_root_path , backup_key )) for backup_key in backup_dict .keys ()
237+ }
232238 file_paths = set (io_util .get_file_list (backup_root_path ))
233239 files_not_in_backup = list (file_paths .difference (backup_paths ))
234240 backups_not_in_directory = list (backup_paths .difference (file_paths ))
0 commit comments