Skip to content

Commit

Permalink
Ensure SETTINGS_SUBSCRIPTIONS is loaded before webviz_settings (#661
Browse files Browse the repository at this point in the history
)
  • Loading branch information
anders-kiaer authored Dec 11, 2022
1 parent 45010bf commit bef5f2f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions webviz_config/templates/copy_data_template.py.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ theme.from_json((Path(__file__).resolve().parent / "theme_settings.json").read_t
app = dash.Dash()
app.config.suppress_callback_exceptions = True

# Trigger import of plugins used, such that SHARED_SETTINGS_SUBSCRIPTIONS
# is populated before setting webviz_settings
{% for page in pageContents %}
{% for content in page.content %}
{% if content is not string %}
webviz_config.plugins.{{ content._call_signature[0].split('(')[0]}}
{% endif %}
{% endfor %}
{% endfor %}

# Create the common webviz_setting object that will get passed as an
# argument to all plugins that request it.
webviz_settings: webviz_config.WebvizSettings = webviz_config.WebvizSettings(
Expand Down
11 changes: 11 additions & 0 deletions webviz_config/templates/webviz_template.py.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ print("Configuring logging from dictionary:", logging_config_dict)
logging.config.dictConfig(logging_config_dict)
{% endif %}


# Trigger import of plugins used, such that SHARED_SETTINGS_SUBSCRIPTIONS
# is populated before setting webviz_settings
{% for page in pageContents %}
{% for content in page.content %}
{% if content is not string %}
webviz_config.plugins.{{ content._call_signature[0].split('(')[0]}}
{% endif %}
{% endfor %}
{% endfor %}

# Create the common webviz_setting object that will get passed as an
# argument to all plugins that request it.
webviz_settings: webviz_config.WebvizSettings = webviz_config.WebvizSettings(
Expand Down

0 comments on commit bef5f2f

Please sign in to comment.