ReadJSShifts plugin handles correctly empty records

parent f71ce75d
...@@ -53,7 +53,7 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin): ...@@ -53,7 +53,7 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin):
# if all the records of that line are none then continue # if all the records of that line are none then continue
toContinue = False toContinue = False
for record in line: for record in line:
if record != None: if record != None and record!='':
toContinue = True toContinue = True
break break
if not toContinue: if not toContinue:
...@@ -64,12 +64,12 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin): ...@@ -64,12 +64,12 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin):
timeEndList = [] timeEndList = []
#if no shift start was given, assume standard 8:00 #if no shift start was given, assume standard 8:00
startTime = line[2] startTime = line[2]
if startTime == '': if startTime == '' or startTime == None:
startTime = "08:00" startTime = "08:00"
shiftStart = self.convertToSimulationTime(strptime("%s %s" % (line[1], startTime), '%Y/%m/%d %H:%M')) shiftStart = self.convertToSimulationTime(strptime("%s %s" % (line[1], startTime), '%Y/%m/%d %H:%M'))
#if no shift end was given, assume standard 18:00 #if no shift end was given, assume standard 18:00
endTime = line[3] endTime = line[3]
if endTime == '': if endTime == '' or endTime == None:
endTime = "18:00" endTime = "18:00"
shiftEnd = self.convertToSimulationTime(strptime("%s %s" % (line[1], endTime), '%Y/%m/%d %H:%M')) shiftEnd = self.convertToSimulationTime(strptime("%s %s" % (line[1], endTime), '%Y/%m/%d %H:%M'))
timePair = self.correctTimePair(shiftStart, shiftEnd) timePair = self.correctTimePair(shiftStart, shiftEnd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment