Private
Public Access
1
0

Merge branch 'release/v13.93' into master

This commit is contained in:
Sander Roosendaal
2020-09-29 21:51:14 +02:00
2 changed files with 11 additions and 6 deletions

View File

@@ -72,6 +72,7 @@ import pandas as pd
import numpy as np import numpy as np
import itertools import itertools
from fitparse import FitFile from fitparse import FitFile
from fitparse.base import FitHeaderError
import math import math
from rowers.tasks import ( from rowers.tasks import (
handle_sendemail_unrecognized, handle_sendemail_breakthrough, handle_sendemail_unrecognized, handle_sendemail_breakthrough,
@@ -1586,7 +1587,11 @@ def handle_nonpainsled(f2, fileformat, summary=''):
# Currently there is code duplication # Currently there is code duplication
def get_workouttype_from_fit(filename,workouttype='water'): def get_workouttype_from_fit(filename,workouttype='water'):
fitfile = FitFile(filename,check_crc=False) try:
fitfile = FitFile(filename,check_crc=False)
except FitHeaderError:
return workouttype
records = fitfile.messages records = fitfile.messages
fittype = 'rowing' fittype = 'rowing'
for record in records: for record in records:

View File

@@ -2744,8 +2744,8 @@ def fetch_strava_workout(stravatoken,oauth_data,stravaid,csvfilename,userid,debu
url = "https://www.strava.com/api/v3/activities/"+str(stravaid) url = "https://www.strava.com/api/v3/activities/"+str(stravaid)
response = requests.get(url,headers=headers) response = requests.get(url,headers=headers)
if response.status_code != 200: if response.status_code != 200:
t = time.localtime() tstamp = time.localtime()
timestamp = time.strftime('%b-%d-%Y_%H%M', t) timestamp = time.strftime('%b-%d-%Y_%H%M', tstamp)
with open('strava_webhooks.log','a') as f: with open('strava_webhooks.log','a') as f:
f.write('\n') f.write('\n')
f.write(timestamp) f.write(timestamp)
@@ -2781,8 +2781,8 @@ def fetch_strava_workout(stravatoken,oauth_data,stravaid,csvfilename,userid,debu
coords = get_strava_stream(None,'latlng',stravaid,authorizationstring=authorizationstring) coords = get_strava_stream(None,'latlng',stravaid,authorizationstring=authorizationstring)
power = get_strava_stream(None,'watts',stravaid,authorizationstring=authorizationstring) power = get_strava_stream(None,'watts',stravaid,authorizationstring=authorizationstring)
t = time.localtime() tstamp = time.localtime()
timestamp = time.strftime('%b-%d-%Y_%H%M', t) timestamp = time.strftime('%b-%d-%Y_%H%M', tstamp)
with open('strava_webhooks.log','a') as f: with open('strava_webhooks.log','a') as f:
f.write('\n') f.write('\n')
f.write(timestamp) f.write(timestamp)
@@ -2840,7 +2840,7 @@ def fetch_strava_workout(stravatoken,oauth_data,stravaid,csvfilename,userid,debu
strokelength = velo2*60./(spm) strokelength = velo*60./(spm)
strokelength[np.isinf(strokelength)] = 0.0 strokelength[np.isinf(strokelength)] = 0.0