(name, props, description, project_shortname, prefix)
| 498 | |
| 499 | |
| 500 | def 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…