mirror of
https://github.com/norohind/EDMC_SpanshRouter.git
synced 2025-04-20 19:17:36 +03:00
Fixed issue with blank lines in CSV files
This commit is contained in:
parent
913b94cb1a
commit
a8b4e62a27
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"python.pythonPath": "/usr/bin/python2"
|
||||
}
|
BIN
EDMC_SpanshRouter_210.zip
Normal file
BIN
EDMC_SpanshRouter_210.zip
Normal file
Binary file not shown.
8
load.py
8
load.py
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user