Merge branch 'release/v9.87'
This commit is contained in:
File diff suppressed because it is too large
Load Diff
+6
-7
@@ -1205,7 +1205,10 @@ def parsenonpainsled(fileformat,f2,summary):
|
||||
fileformat = fileformat+'v'+str(empowerfirmware)
|
||||
else:
|
||||
fileformat = 'speedcoach2v0'
|
||||
try:
|
||||
summary = row.allstats()
|
||||
except ZeroDivisionError:
|
||||
summary = ''
|
||||
|
||||
|
||||
# handle FIT
|
||||
@@ -1225,18 +1228,14 @@ def handle_nonpainsled(f2, fileformat, summary=''):
|
||||
inboard = 0.88
|
||||
hasrecognized = False
|
||||
|
||||
try:
|
||||
row,hasrecognized,summary,fileformat = parsenonpainsled(fileformat,f2,summary)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
# Handle c2log
|
||||
if (fileformat == 'c2log' or fileformat == 'rowprolog'):
|
||||
return (0,0,0,0,0)
|
||||
return (0,'',0,0,'')
|
||||
|
||||
if not hasrecognized:
|
||||
return (0,0,0,0,0)
|
||||
return (0,'',0,0,'')
|
||||
|
||||
f_to_be_deleted = f2
|
||||
# should delete file
|
||||
@@ -1245,7 +1244,7 @@ def handle_nonpainsled(f2, fileformat, summary=''):
|
||||
row2 = rrdata(df = row.df)
|
||||
row2.write_csv(f2, gzip=True)
|
||||
except:
|
||||
return (0,0,0,0,0)
|
||||
return (0,'',0,0,'')
|
||||
|
||||
# os.remove(f2)
|
||||
try:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
from django.utils import timezone
|
||||
from rowers.models import Workout, PowerTimeFitnessMetric, Rower
|
||||
from rowers.models import Workout, PowerTimeFitnessMetric, Rower, PaidPlan
|
||||
import datetime
|
||||
from rowers.utils import myqueue
|
||||
import django_rq
|
||||
|
||||
BIN
Binary file not shown.
+9
-7
@@ -50,7 +50,6 @@ def get_metar_data(airportcode,unixtime):
|
||||
url += str(unixtime+3600)
|
||||
url += "&stationString="+airportcode
|
||||
|
||||
|
||||
try:
|
||||
s = requests.get(url)
|
||||
except:
|
||||
@@ -60,13 +59,16 @@ def get_metar_data(airportcode,unixtime):
|
||||
|
||||
if s.ok:
|
||||
doc = etree.fromstring(s.content)
|
||||
lengte = len(doc.xpath('data/METAR/station_id'))
|
||||
print('Lengte ',lengte,int(lengte/2))
|
||||
idnr = int(lengte/2)
|
||||
try:
|
||||
id = doc.xpath('data/METAR/station_id')[0].text
|
||||
temp_c = doc.xpath('data/METAR/temp_c')[0].text
|
||||
wind_dir = doc.xpath('data/METAR/wind_dir_degrees')[0].text
|
||||
wind_speed = doc.xpath('data/METAR/wind_speed_kt')[0].text
|
||||
timestamp = doc.xpath('data/METAR/observation_time')[0].text
|
||||
rawtext = doc.xpath('data/METAR/raw_text')[0].text
|
||||
id = doc.xpath('data/METAR/station_id')[idnr].text
|
||||
temp_c = doc.xpath('data/METAR/temp_c')[idnr].text
|
||||
wind_dir = doc.xpath('data/METAR/wind_dir_degrees')[idnr].text
|
||||
wind_speed = doc.xpath('data/METAR/wind_speed_kt')[idnr].text
|
||||
timestamp = doc.xpath('data/METAR/observation_time')[idnr].text
|
||||
rawtext = doc.xpath('data/METAR/raw_text')[idnr].text
|
||||
except IndexError:
|
||||
message = 'Failed to download METAR data'
|
||||
return [0,0,message,'',timestamp]
|
||||
|
||||
Reference in New Issue
Block a user