From ff94d945447bb11d970c1abd6a438e5826678372 Mon Sep 17 00:00:00 2001 From: Umit Kablan Date: Mon, 30 Sep 2024 11:25:28 +0300 Subject: [PATCH] fix pyflake indent issues 2 --- pleskdistup/actions/distupgrade.py | 14 +++++++++----- pleskdistup/common/src/files.py | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pleskdistup/actions/distupgrade.py b/pleskdistup/actions/distupgrade.py index aa23f81..c15b5cc 100644 --- a/pleskdistup/actions/distupgrade.py +++ b/pleskdistup/actions/distupgrade.py @@ -180,10 +180,12 @@ def name(self, val: str) -> None: self._name = val def _do_check(self) -> bool: - log.debug(f"Checking leftover repo.list files") - archived_files = [f for f in + log.debug("Checking leftover repo.list files") + archived_files = [ + f for f in CheckAptReposBackups.get_all_repo_list_files(self.sources_list_path, self.sources_list_d_path) - if files.backup_exists(f)] + if files.backup_exists(f) + ] if archived_files: self.description = self.description.format(",".join(archived_files)) return False @@ -235,8 +237,10 @@ def _apply_replace_to_file(self, fpath: str, ptrn: re.Pattern, to_regexp: str) - f.writelines(new_lines) def _get_all_repo_list_files(self) -> typing.List[str]: - return CheckAptReposBackups.get_all_repo_list_files(self.sources_list_path, - self.sources_list_d_path) + return CheckAptReposBackups.get_all_repo_list_files( + self.sources_list_path, + self.sources_list_d_path, + ) def _rm_backups(self) -> None: for f in self._get_all_repo_list_files(): diff --git a/pleskdistup/common/src/files.py b/pleskdistup/common/src/files.py index 375e441..2384ecb 100644 --- a/pleskdistup/common/src/files.py +++ b/pleskdistup/common/src/files.py @@ -13,6 +13,7 @@ DEFAULT_BACKUP_EXTENSION = ".conversion.bak" + def replace_string(filename: str, original_substring: str, new_substring: str) -> None: with open(filename, "r") as original, open(filename + ".next", "w") as dst: for line in original.readlines():