This Python script, replace_function_code.py
, is designed to replace a placeholder in a YAML file with the content of a Python file.
The script requires three positional arguments:
yaml_file
: This is the YAML file to be processed.python_file
: The Python file whose content will be inserted into the YAML file.placeholder
: The string in the YAML file to be replaced.
The script also accepts two optional arguments:
-o
or--output
: This allows you to specify the name of the output file. If not provided, the default output file name is "output.yaml".-w
or--overwrite
: If this option is set, the original YAML file will be overwritten with the processed content.