Fixed issue with blank lines in CSV files

This commit is contained in:
CMDR-Kiel42 2019-07-30 20:26:13 +02:00
parent 913b94cb1a
commit a8b4e62a27
3 changed files with 8 additions and 3 deletions

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"python.pythonPath": "/usr/bin/python2"
}

BIN
EDMC_SpanshRouter_210.zip Normal file

Binary file not shown.

View File

@ -60,7 +60,8 @@ def plugin_start(plugin_dir):
route_reader = csv.reader(csvfile)
for row in route_reader:
this.route.append(row)
if row not in (None, "", []):
this.route.append(row)
try:
with open(this.offset_file_path, 'r') as offset_fh:
@ -204,8 +205,9 @@ def plot_csv(self=None):
this.jumps_left = 0
for row in route_reader:
this.route.append([row[0], row[4]])
this.jumps_left += int(row[4])
if row not in (None, "", []):
this.route.append([row[0], row[4]])
this.jumps_left += int(row[4])
this.offset = 0
this.next_stop = this.route[0][0]