Skip to content

Commit

Permalink
fix uncatched exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelAltynnikov committed May 15, 2022
1 parent 4c3d4bf commit d7e0be7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ def main():
return
print(f"Вы выбрали папку {isopoly_dir}")

legends_data = legend.parse_legends(legend.find_legends_data_path(isopoly_dir))
result_path = os.path.join(isopoly_dir, "merge result")
source.create_dir(result_path)
try:

legends_data = legend.parse_legends(legend.find_legends_data_path(isopoly_dir))
result_path = os.path.join(isopoly_dir, "merge result")
source.create_dir(result_path)

isopolies = [
Isopoly(PIL.Image.open(os.path.join(isopoly_dir, file_name)))
for file_name in os.listdir(isopoly_dir)
if file_name.endswith("png")
]
isopolies = [
Isopoly(PIL.Image.open(os.path.join(isopoly_dir, file_name)))
for file_name in os.listdir(isopoly_dir)
if file_name.endswith("png")
]

if not isopolies:
print('Не удалось найти ни одного изополя')
return

try:

for isopoly in isopolies:
isopoly.set_data_into_legend(legends_data)
isopoly.fill_legend()
Expand Down

0 comments on commit d7e0be7

Please sign in to comment.