work in progress: now has alternative way to find chart settings
This commit is contained in:
@@ -19,6 +19,9 @@ import yamllint
|
|||||||
from subprocess import call
|
from subprocess import call
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from verbal_expressions import VerEx
|
||||||
|
|
||||||
|
|
||||||
import django_rq
|
import django_rq
|
||||||
queue = django_rq.get_queue('default')
|
queue = django_rq.get_queue('default')
|
||||||
queuelow = django_rq.get_queue('low')
|
queuelow = django_rq.get_queue('low')
|
||||||
@@ -45,6 +48,29 @@ def cleanbody(body):
|
|||||||
|
|
||||||
return body
|
return body
|
||||||
|
|
||||||
|
def matchchart(line):
|
||||||
|
results = []
|
||||||
|
tester = VerEx().start_of_line().find('chart')
|
||||||
|
tester2 = VerEx().start_of_line().find('chart').anything().find('distance')
|
||||||
|
tester3 = VerEx().start_of_line().find('chart').anything().find('time')
|
||||||
|
tester4 = VerEx().start_of_line().find('chart').anything().find('pie')
|
||||||
|
if tester.match(line):
|
||||||
|
if tester2.match(line):
|
||||||
|
return 'distanceplot'
|
||||||
|
if tester3.match(line):
|
||||||
|
return 'timeplot'
|
||||||
|
if tester3.match(line):
|
||||||
|
return 'pieplot'
|
||||||
|
|
||||||
|
def get_plotoptions_body2(uploadoptions,body):
|
||||||
|
for line in body.splitlines():
|
||||||
|
chart = matchchart(line)
|
||||||
|
if chart:
|
||||||
|
uploadoptions['make_plot'] = True
|
||||||
|
uploadoptions['plottype'] = chart
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def getsyncoptions(uploadoptions,values):
|
def getsyncoptions(uploadoptions,values):
|
||||||
try:
|
try:
|
||||||
value = values.lower()
|
value = values.lower()
|
||||||
|
|||||||
Reference in New Issue
Block a user