nvflare.lighter.ctx module¶
- class ProvisionContext(workspace_root_dir: str, project: Project)[source]¶
Bases:
dict
- build_from_template(dest_dir: str, temp_section: str | List[str], file_name, replacement=None, mode='t', exe=False, content_modify_cb=None, **cb_kwargs)[source]¶
Build a file from a template section and writes it to the specified location.
- Parameters:
dest_dir – destination directory
temp_section – template section key
file_name – file name
replacement – replacement dict
mode – file mode
exe – executable
content_modify_cb – content modification callback. If specified, it takes the section content as the first argument and returns the modified content
cb_kwargs – additional keyword arguments for the callback
- build_section_from_template(temp_section: str | List[str], replacement=None, content_modify_cb=None, **cb_kwargs)[source]¶