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

Function generate_struct_file

dash/development/_jl_components_generation.py:500–520  ·  view source on GitHub ↗
(name, props, description, project_shortname, prefix)

Source from the content-addressed store, hash-verified

498
499
500def generate_struct_file(name, props, description, project_shortname, prefix):
501 props = reorder_props(props=props)
502 import_string = "# AUTO GENERATED FILE - DO NOT EDIT\n"
503 class_string = generate_class_string(
504 name, props, description, project_shortname, prefix
505 )
506
507 file_name = format_fn_name(prefix, name) + ".jl"
508
509 # put component files in src/jl subdir,
510 # this also creates the Julia source directory for the package
511 # if it is missing
512 if not os.path.exists("src/jl"):
513 os.makedirs("src/jl")
514
515 file_path = os.path.join("src", "jl", file_name)
516 with open(file_path, "w", encoding="utf-8") as f:
517 f.write(import_string)
518 f.write(class_string)
519
520 print("Generated {}".format(file_name))
521
522
523# pylint: disable=unused-argument

Callers

nothing calls this directly

Calls 5

reorder_propsFunction · 0.85
generate_class_stringFunction · 0.70
format_fn_nameFunction · 0.70
existsMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…