Commit 42c84417 authored by Flavio TARSETTI's avatar Flavio TARSETTI
Browse files

[experiments/plotters] inputdata is guessed by the type() str or dict

parent db9e6f87
......@@ -502,8 +502,8 @@ def plot(webapi, configuration, prefix, names, remote_results, force, indentatio
output_name = key + '.png'
output_name = os.path.join(output_folder, output_name)
pl_status = plotters_pull(webapi, configuration.path, [value['type']], force, indentation + 2, {})
plot_status = plotters_plot(webapi, configuration.path, [value['type']], False, False, None,
output_name, None, indentation + 2, format_cache, value['value'])
plot_status = plotters_plot(webapi, configuration.path, [value['type']], False, False, value['value'],
output_name, None, indentation + 2, format_cache)
status += pl_status
status += plot_status
else:
......@@ -546,8 +546,8 @@ def plot(webapi, configuration, prefix, names, remote_results, force, indentatio
output_name = the_data + '.png'
output_name = os.path.join(output_folder, output_name)
pl_status = plotters_pull(webapi, configuration.path, [datatype], force, indentation + 2, {})
plot_status = plotters_plot(webapi, configuration.path, [datatype], False, False, None,
output_name, None, indentation + 2, format_cache, data.as_dict()[the_data])
plot_status = plotters_plot(webapi, configuration.path, [datatype], False, False,
data.as_dict()[the_data], output_name, None, indentation + 2, format_cache)
status += pl_status
status += plot_status
......
......@@ -133,7 +133,7 @@ def pull(webapi, prefix, names, force, indentation, format_cache):
return status + lb_status + df_status
def plot(webapi, prefix, names, force, need_data_sample, inputdata, outputimage, plotterparameter, indentation, format_cache, buffer_inputdata=None):
def plot(webapi, prefix, names, force, need_data_sample, inputdata, outputimage, plotterparameter, indentation, format_cache):
"""plot sample plot from the server.
Parameters:
......@@ -197,18 +197,23 @@ def plot(webapi, prefix, names, force, need_data_sample, inputdata, outputimage,
sample_data = simplejson.loads(sample_data['sample_data'])
# provide data
if inputdata is None and not need_data_sample and buffer_inputdata is None:
if inputdata is None and not need_data_sample:
message = 'Error: Missing --sample_data argument or inputdata'
print(message)
import sys
sys.exit()
elif inputdata is not None:
with open(os.path.join(prefix, inputdata), 'r') as f:
sample_data = simplejson.load(f)
f.closed
elif inputdata is None and buffer_inputdata is not None:
sample_data = buffer_inputdata
if type(inputdata) is str:
with open(os.path.join(prefix, inputdata), 'r') as f:
sample_data = simplejson.load(f)
f.closed
elif type(inputdata) is dict:
sample_data = inputdata
else:
message = 'Error: inputdata should be dict or str type'
print(message)
import sys
sys.exit()
# output
plotter_path = os.path.join(prefix, common.TYPE_PLURAL['plotter'], name.rsplit('/', 1)[0])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment