Private
Public Access
1
0

removed unnecessary else

This commit is contained in:
Sander Roosendaal
2019-12-22 15:14:39 +01:00
parent 77f7cf4844
commit 2bd9d96273

View File

@@ -1581,21 +1581,29 @@ def handle_otwsetpower(self,f1, boattype, weightvalue,
grpc.channel_ready_future(channel).result(timeout=10)
except grpc.FutureTimeoutError:
return 0
else:
stub = calculator_pb2_grpc.PowerStub(channel)
response = stub.CalcPower(calculator_pb2.WorkoutPowerRequest(
filename = csvfile,
boattype = boattype,
crewmass = weightvalue,
powermeasured = powermeasured,
progressurl = progressurl,
secret = secret,
silent = False,
),timeout=1200)
result = response.result
if result == 0:
# send failure email
return 0
stub = calculator_pb2_grpc.PowerStub(channel)
response = stub.CalcPower(calculator_pb2.WorkoutPowerRequest(
filename = csvfile,
boattype = boattype,
crewmass = weightvalue,
powermeasured = powermeasured,
progressurl = progressurl,
secret = secret,
silent = False,
),timeout=1200)
result = response.result
if result == 0:
# send failure email
return 0
# do something with boat type
try:
rowdata = rdata(csvfile)
except IOError:
try:
rowdata = rdata(csvfile)
except IOError:
rowdata = rdata(csvfile)
else:
boatfile = {