Skip to content

Commit ad951c1

Browse files
committed
fix dynamic import
1 parent d235879 commit ad951c1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crystal_toolkit/core/plugin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ def crystal_toolkit_layout(self, layout) -> html.Div:
9292
layout = layout()
9393

9494
stores_to_add = []
95-
MPComponent = import_module("crystal_toolkit.core.mpcomponent.MPComponent")
96-
for basename in MPComponent._all_id_basenames:
95+
mpcomp_module = import_module("crystal_toolkit.core.mpcomponent")
96+
for basename in mpcomp_module.MPComponent._all_id_basenames:
9797
# can use "if basename in layout_str:" to restrict to components present in initial layout
9898
# this would cause bugs for components displayed dynamically
99-
stores_to_add += MPComponent._app_stores_dict[basename]
99+
stores_to_add += mpcomp_module.MPComponent._app_stores_dict[basename]
100100
layout.children += stores_to_add
101101

102-
for component in MPComponent._callbacks_to_generate:
102+
for component in mpcomp_module.MPComponent._callbacks_to_generate:
103103
component.generate_callbacks(self.app, self.cache)
104104

105105
return layout

0 commit comments

Comments
 (0)