Skip to content

Instantly share code, notes, and snippets.

@mjkramer
Last active February 28, 2018 22:46
Show Gist options
  • Save mjkramer/2973139268bc035a8f92864dcfbee0d5 to your computer and use it in GitHub Desktop.
Save mjkramer/2973139268bc035a8f92864dcfbee0d5 to your computer and use it in GitHub Desktop.
import os as _os
import dash as _dash
import sys as _sys
from importlib.util import find_spec
_components = _dash.development.component_loader.load_components(
_os.path.dirname(find_spec('ipop_components').origin) + '/metadata.json',
'ipop_components'
)
_this_module = _sys.modules[__name__]
_js_dist = [
{
"external_url": "https://codepen.io/mjkramer/pen/oEmzOK.js",
"namespace": "ipop_components"
}
]
_css_dist = []
for _component in _components:
setattr(_this_module, _component.__name__, _component)
setattr(_component, '_js_dist', _js_dist)
setattr(_component, '_css_dist', _css_dist)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment