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

Function generate_toml_file

dash/development/_jl_components_generation.py:415–443  ·  view source on GitHub ↗
(project_shortname, pkg_data)

Source from the content-addressed store, hash-verified

413
414
415def generate_toml_file(project_shortname, pkg_data):
416 package_author = pkg_data.get("author", "")
417 project_ver = pkg_data.get("version")
418 package_name = jl_package_name(project_shortname)
419 u = uuid.UUID(jl_dash_uuid)
420
421 package_uuid = uuid.UUID(
422 hex=u.hex[:-12] + hashlib.sha256(package_name.encode("utf-8")).hexdigest()[-12:]
423 )
424
425 authors_string = (
426 'authors = ["{}"]\n'.format(package_author) if package_author else ""
427 )
428
429 base_package = base_package_name(project_shortname)
430
431 toml_string = jl_projecttoml_string.format(
432 package_name=package_name,
433 package_uuid=package_uuid,
434 version=project_ver,
435 authors=authors_string,
436 base_package=base_package,
437 base_version=jl_base_version[base_package],
438 dash_uuid=base_package_uid(project_shortname),
439 )
440 file_path = "Project.toml"
441 with open(file_path, "w", encoding="utf-8") as f:
442 f.write(toml_string)
443 print("Generated {}".format(file_path))
444
445
446def generate_class_string(name, props, description, project_shortname, prefix):

Callers 1

generate_moduleFunction · 0.85

Calls 5

jl_package_nameFunction · 0.85
base_package_nameFunction · 0.85
base_package_uidFunction · 0.85
getMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…