Commit 9afff27f authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[experiments] Improve plotter name retrieval

The current way of converting the name did not take
into account that the plotter name itself could contain
an underscore. This new method will get the part between
the first and last underscore and then recombine the rest.

Only caveat is if the user name also contains an underscore.
However, currently only the user plot can provide plotters.
parent 2a8de19c
......@@ -587,8 +587,13 @@ def plot_impl(configuration, names, remote, show, output_folder):
if issubclass(type(field_data), SIMPLE_TYPES):
encoded_name = field_data.__class__.__name__
user_name = encoded_name[: encoded_name.find("_")]
name = encoded_name[len(user_name) + 1 : encoded_name.rfind("_")]
version = encoded_name[encoded_name.rfind("_") + 1 :]
plot_data = {
"type": field_data.__class__.__name__.replace("_", "/"),
"type": "/".join([user_name, name, version]),
"primary": True,
"value": field_data,
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