Private
Public Access
1
0

small refinement upload

This commit is contained in:
Sander Roosendaal
2017-11-08 15:16:05 +01:00
parent 29b93a00fd
commit 7acc41fa6f
3 changed files with 24 additions and 19 deletions

View File

@@ -34,7 +34,7 @@ except:
from rowers.utils import (
geo_distance,serialize_list,deserialize_list,uniqify,
str2bool,range_to_color_hex,absolute
str2bool,range_to_color_hex,absolute,myqueue
)
def cleanbody(body):
@@ -51,10 +51,16 @@ def cleanbody(body):
# currently only matches one chart
def matchchart(line):
results = []
tester = VerEx().start_of_line().find('chart').OR().find('plot')
tester2 = VerEx().start_of_line().find('chart').OR().find('plot').anything().find('distance')
tester3 = VerEx().start_of_line().find('chart').OR().find('plot').anything().find('time')
tester4 = VerEx().start_of_line().find('chart').OR().find('plot').anything().find('pie')
testert = '^((chart)|(plot))'
tester2t = testert+'(.*)(dist)'
tester3t = testert+'(.*)(time)'
tester4t = testert+'(.*)(pie)'
tester = re.compile(testert)
tester2 = re.compile(tester2t)
tester3 = re.compile(tester3t)
tester4 = re.compile(tester4t)
if tester.match(line.lower()):
if tester2.match(line.lower()):
return 'distanceplot'
@@ -262,15 +268,10 @@ def make_plot(r,w,f1,f2,plottype,title,imagename='',plotnr=0):
if w.workouttype in ('water','coastal'):
plotnr = plotnr+3
if settings.DEBUG:
job = handle_makeplot.delay(f1,f2,title,
hrpwrdata,plotnr,
imagename)
else:
job = queue.enqueue(handle_makeplot,f1,f2,
title,hrpwrdata,
plotnr,imagename)
job = myqueue(queue,handle_makeplot,f1,f2,
title,hrpwrdata,
plotnr,imagename)
try:
width,height = Image.open(fullpathimagename).size