MCPcopy
hub / github.com/plotly/dash / write_class_file

Function write_class_file

dash/development/_r_components_generation.py:458–485  ·  view source on GitHub ↗
(
    name,
    props,
    description,
    project_shortname,
    prefix=None,
    rpkg_data=None,
)

Source from the content-addressed store, hash-verified

456
457# pylint: disable=too-many-arguments
458def write_class_file(
459 name,
460 props,
461 description,
462 project_shortname,
463 prefix=None,
464 rpkg_data=None,
465):
466 props = reorder_props(props=props)
467
468 # generate the R help pages for each of the Dash components that we
469 # are transpiling -- this is done to avoid using Roxygen2 syntax,
470 # we may eventually be able to generate similar documentation using
471 # doxygen and an R plugin, but for now we'll just do it on our own
472 # from within Python
473 write_help_file(name, props, description, prefix, rpkg_data)
474
475 import_string = "# AUTO GENERATED FILE - DO NOT EDIT\n\n"
476 class_string = generate_class_string(name, props, project_shortname, prefix)
477
478 file_name = format_fn_name(prefix, name) + ".R"
479
480 file_path = os.path.join("R", file_name)
481 with open(file_path, "w", encoding="utf-8") as f:
482 f.write(import_string)
483 f.write(class_string)
484
485 print("Generated {}".format(file_name))
486
487
488def write_js_metadata(pkg_data, project_shortname, has_wildcards):

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…