Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2019-07-12 10:34:51 +02:00
parent 84a08bcd7f
commit 98428e736e
6 changed files with 108 additions and 36 deletions

View File

@@ -30,7 +30,7 @@ queue = django_rq.get_queue('default')
queuelow = django_rq.get_queue('low')
queuehigh = django_rq.get_queue('high')
from rowers.mytypes import workouttypes,boattypes,otwtypes,workoutsources
from rowers.mytypes import workouttypes,boattypes,otwtypes,workoutsources, workouttypes_ordered
try:
from cStringIO import StringIO
@@ -156,13 +156,14 @@ def gettypeoptions_body2(uploadoptions,body):
testerb = re.compile('^(boat)')
for line in body.splitlines():
if tester.match(line.lower()):
for typ,verb in workouttypes:
for typ,verb in workouttypes_ordered.items():
str1 = '^(workout)(.*)({a})'.format(
a = typ.lower()
)
testert = re.compile(str1)
if testert.match(line.lower()):
uploadoptions['workouttype'] = typ
break
if testerb.match(line.lower()):
for typ,verb in boattypes:
str1 = '^(boat)(.*)({a})'.format(
@@ -170,7 +171,8 @@ def gettypeoptions_body2(uploadoptions,body):
)
testert = re.compile(str1)
if testert.match(line.lower()):
uploadoptions['boattype'] = typ
uploadoptions['boattype'] = typ
break
return uploadoptions
@@ -286,11 +288,13 @@ def getplotoptions(uploadoptions,value):
def gettype(uploadoptions,value,key):
workouttype = 'rower'
for typ,verb in workouttypes:
for typ,verb in workouttypes_ordered.items():
if value == typ:
workouttype = typ
break
if value == verb:
workouttype = typ
break
uploadoptions[key] = workouttype