Private
Public Access
1
0

another batch of files with a light sprinkle of comments

This commit is contained in:
Sander Roosendaal
2017-01-15 16:06:14 +01:00
parent 737ac5fd3f
commit e5810dbf62
11 changed files with 64 additions and 11 deletions

View File

@@ -21,12 +21,12 @@ from rowers.dataprepnodjango import update_strokedata
from django.core.mail import send_mail, BadHeaderError,EmailMessage
# testing task
@app.task
def add(x, y):
return x + y
# send email to me when an unrecognized file is uploaded
@app.task
def handle_sendemail_unrecognized(unrecognizedfile,useremail):
@@ -51,7 +51,7 @@ def handle_sendemail_unrecognized(unrecognizedfile,useremail):
os.remove(unrecognizedfile)
return 1
# Send email with TCX attachment
@app.task
def handle_sendemailtcx(first_name,last_name,email,tcxfile):
@@ -75,6 +75,7 @@ def handle_sendemailtcx(first_name,last_name,email,tcxfile):
os.remove(tcxfile)
return 1
# Send email with CSV attachment
@app.task
def handle_sendemailcsv(first_name,last_name,email,csvfile):
@@ -104,6 +105,7 @@ def handle_sendemailcsv(first_name,last_name,email,csvfile):
return 1
# Calculate wind and stream corrections for OTW rowing
@app.task
def handle_otwsetpower(f1,boattype,weightvalue,
first_name,last_name,email,workoutid,
@@ -129,7 +131,7 @@ def handle_otwsetpower(f1,boattype,weightvalue,
except KeyError:
rg = rowingdata.getrigging('static/rigging/1x.txt')
# do calculation
# do calculation, but do not overwrite NK Empower Power data
powermeasured = False
try:
w = rowdata.df['wash']
@@ -166,6 +168,7 @@ def handle_otwsetpower(f1,boattype,weightvalue,
return 1
# This function generates all the static (PNG image) plots
@app.task
def handle_makeplot(f1,f2,t,hrdata,plotnr,imagename):
hrmax = hrdata['hrmax']
@@ -222,5 +225,6 @@ def handle_makeplot(f1,f2,t,hrdata,plotnr,imagename):
return imagename
# Another simple task for debugging purposes
def add2(x,y):
return x+y