Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
saramonzon committed Oct 3, 2023
1 parent 52e4c0f commit 5dfaf5c
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions bu_isciii/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,12 @@ def targz_directory(self, direction):
if os.path.exists(dir_to_tar + ".tar.gz"):
stderr.print(
f"Seems like service {service} has already been compressed in the {location_check} dir",
f"Path: {dir_to_tar + '.tar.gz'}\n"
f"Path: {dir_to_tar + '.tar.gz'}\n",
)
if self.skip_prompts:
prompt_response = f"Delete previous {service + '.tar.gz'} and compress again"
prompt_response = (
f"Delete previous {service + '.tar.gz'} and compress again"
)
message = "automatically selected due to --skip-prompts"
else:
message = "selected throught prompt"
Expand All @@ -438,17 +440,22 @@ def targz_directory(self, direction):

try:
if prompt_response:
if (prompt_response.startswith("Delete")):
if prompt_response.startswith("Delete"):
log.info(
f"Service {service}: compressed service {dir_to_tar + '.tar.gz'} was already found."
f"Option chosen is to DELETE it ({message})"
"Compression process will be performed again."
)
f"Service {service}: compressed service {dir_to_tar + '.tar.gz'} was already found."
f"Option chosen is to DELETE it ({message})"
"Compression process will be performed again."
)
os.remove(dir_to_tar + ".tar.gz")
else:
self.services[service]["compressed"] = "Found already compressed"
self.services[service][
"compressed"
] = "Found already compressed"

if not self.services[service]["compressed"] == "Found already compressed":
if (
not self.services[service]["compressed"]
== "Found already compressed"
):
stderr.print(f"Compressing service {service}")
bu_isciii.utils.targz_dir(dir_to_tar + ".tar.gz", dir_to_tar)
self.services[service]["compressed"] = "Successfully compressed"
Expand Down Expand Up @@ -1151,7 +1158,7 @@ def generate_tsv_table(self, filename):
"Moving process": None,
"Uncompressing process": None,
"Deletion process": None,
"Error": None
"Error": None,
}

infile.write("\t".join(list(csv_dict.keys())) + "\n")
Expand Down

0 comments on commit 5dfaf5c

Please sign in to comment.