Private
Public Access
1
0

implemented make_plot

This commit is contained in:
Sander Roosendaal
2017-09-26 12:57:00 +02:00
parent 4ec43770db
commit d56a8bb74d
3 changed files with 45 additions and 10 deletions

View File

@@ -83,16 +83,32 @@ def getplotoptions(uploadoptions,value):
return uploadoptions
def getboolean(uploadoptions,value,key):
b = True
if not value:
b = False
if value in [False,'false','False',None,'no']:
b = False
uploadoptions[key] = b
return uploadoptions
def upload_options(body):
uploadoptions = {}
body = cleanbody(body)
try:
yml = (yaml.load(body))
for key, value in yml.iteritems():
if key == 'sync' or key == 'synchronization':
uploadoptions = getsyncoptions(uploadoptions,value)
if key == 'chart' or key == 'static' or key == 'plot':
uploadoptions = getplotoptions(uploadoptions,value)
try:
for key, value in yml.iteritems():
if key == 'sync' or key == 'synchronization':
uploadoptions = getsyncoptions(uploadoptions,value)
if key == 'chart' or key == 'static' or key == 'plot':
uploadoptions = getplotoptions(uploadoptions,value)
if 'priva' in key:
uploadoptions = getboolean(uploadoptions,value,'makeprivate')
except AttributeError:
pass
except yaml.YAMLError as exc:
pm = exc.problem_mark
strpm = str(pm)