Add only csv files in file explorer + avoid dirty exception if no file is chosen

This commit is contained in:
CMDR-Kiel42 committed 2019-06-01 00:25:03 +02:00
1 parent 5334e3320e
commit 74da851997
1 file changed
+3 -1
+3 -1
View File
@@ -49,7 +49,9 @@ def copy_waypoint(self=None):
this.parent.update()
def new_route(self=None):
filename = filedialog.askopenfilename() # show an "Open" dialog box and return the path to the selected file
filename = filedialog.askopenfilename(filetypes = (("csv files", "*.csv"),)) # show an "Open" dialog box and return the path to the selected file
if filename.__len__() > 0:
this.next_route = filename
with open(filename, 'r') as csvfile: