From 67b1aac12548612719d830d69fb1e41b59fe4ca2 Mon Sep 17 00:00:00 2001 From: Michal Kijowski Date: Fri, 8 May 2020 20:35:15 +0000 Subject: [PATCH] Upload files to '' --- program.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/program.py b/program.py index 0cbf702..852ae65 100644 --- a/program.py +++ b/program.py @@ -14,6 +14,7 @@ import easygui from neurons import Neurons from whereDecision import WhereDecision from Evencik import Evencik +import pathlib class MainWindow: def __init__(self, szerokosc, wysokosc, kruche, latwopalne, radioaktywne, niebezpieczne): @@ -75,7 +76,14 @@ class MainWindow: self.wheel.move(event, self.map) elif(event.type==pygame.MOUSEBUTTONDOWN): if (type(self.map[0][2]) == Floor): - whatIsIt = self.neurons.whatIsIt(easygui.fileopenbox("Wybierz zdjęcie paczki", "Wybierz zdjęcie paczki", filetypes = [["*.jpg", "*.jpeg", "*.png", "Pliki graficzne"]])) + meh = easygui.fileopenbox("Wybierz zdjęcie paczki", "Wybierz zdjęcie paczki", filetypes = [["*.jpg", "*.jpeg", "*.png", "Pliki graficzne"]]) + if meh is None: + return + while pathlib.Path(meh).suffix!=".jpg" and pathlib.Path(meh).suffix!=".jpeg" and pathlib.Path(meh).suffix!=".png": + meh = easygui.fileopenbox("Wybierz zdjęcie paczki", "Wybierz zdjęcie paczki", filetypes = [["*.jpg", "*.jpeg", "*.png", "Pliki graficzne"]]) + if meh is None: + return + whatIsIt = self.neurons.whatIsIt(meh) where = self.whereDecision.recognize(whatIsIt, self.regalsik()) self.map[0][2] = BoxOnTheFloor(self.screen, self.cell, 0, 2, Box()) star = AStar() @@ -143,4 +151,4 @@ class MainWindow: for regal in self.regals: if self.map[regal[0]][regal[1]].isOccupied()==False: tmp.append(regal) - return tmp \ No newline at end of file + return tmp