MCPcopy Index your code
hub / github.com/plotly/dash / generate_module

Function generate_module

dash/development/_jl_components_generation.py:524–552  ·  view source on GitHub ↗
(
    project_shortname, components, metadata, pkg_data, prefix, **kwargs
)

Source from the content-addressed store, hash-verified

522
523# pylint: disable=unused-argument
524def generate_module(
525 project_shortname, components, metadata, pkg_data, prefix, **kwargs
526):
527 # copy over all JS dependencies from the (Python) components dir
528 # the inst/lib directory for the package won't exist on first call
529 # create this directory if it is missing
530 if os.path.exists("deps"):
531 shutil.rmtree("deps")
532
533 os.makedirs("deps")
534
535 for rel_dirname, _, filenames in os.walk(project_shortname):
536 for filename in filenames:
537 extension = os.path.splitext(filename)[1]
538
539 if extension in [".py", ".pyc", ".json"]:
540 continue
541
542 target_dirname = os.path.join(
543 "deps/", os.path.relpath(rel_dirname, project_shortname)
544 )
545
546 if not os.path.exists(target_dirname):
547 os.makedirs(target_dirname)
548
549 shutil.copy(os.path.join(rel_dirname, filename), target_dirname)
550
551 generate_package_file(project_shortname, components, pkg_data, prefix)
552 generate_toml_file(project_shortname, pkg_data)

Callers 1

generate_componentsFunction · 0.85

Calls 5

generate_package_fileFunction · 0.85
generate_toml_fileFunction · 0.85
walkMethod · 0.80
existsMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…