Skip to content

model.py

ofrak.core.patch_maker.model

SourceBundle (FilesystemRoot) dataclass

SourceBundle()

add_source_file(self, code, path) async

Add a source file to this bundle.

Parameters:

Name Type Description Default
code str

The contents of the source file

required
path str

The relative path in the bundle where this file should be added

required
Source code in ofrak/core/patch_maker/model.py
async def add_source_file(self, code: str, path: str):
    """
    Add a source file to this bundle.

    :param code: The contents of the source file
    :param path: The relative path in the bundle where this file should be added
    """
    await self.add_file(
        path,
        code.encode(),
    )