From 59e4054b39889995f64a58aa274a4ea63e9253e5 Mon Sep 17 00:00:00 2001 From: CMDR-Kiel42 Date: Sun, 30 Jun 2019 20:59:24 +0200 Subject: [PATCH] Fixed first waypoint not copied when using new route --- load.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/load.py b/load.py index 3632494..f998c65 100644 --- a/load.py +++ b/load.py @@ -36,6 +36,7 @@ def plugin_start(plugin_dir): this.route[this.offset][1] = '' this.next_stop = this.route[this.offset][0] + copy_waypoint() except: print("No previously saved route.") @@ -76,15 +77,14 @@ def new_route(self=None): 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: route_reader = csv.reader(csvfile) - this.route = [row[0] for row in route_reader] + this.route = [[row[0], ''] for row in route_reader] # Remove the CSV header del this.route[0] + this.offset = 0 this.next_stop = this.route[1][0] copy_waypoint() update_gui()