embdgen.core.region

A region object is a description of a start and end location an in image. It may be part of the partition table.

class embdgen.core.region.Factory.Factory[source]

Bases: FactoryBase[BaseRegion]

classmethod load() Dict[str, Type[BaseRegion]][source]
class embdgen.core.region.BaseRegion.BaseRegion[source]

Bases: ABC

Base class for regions

A region is not necessarily part of the partition table. It is just a part of the final image with a start and a size.

name: str

Name of the region

start: SizeType

Start of the region

This can either be specified or should be calculated automatically by the label implementation.

size: SizeType

Size of the region

This can either be specified or should be calculated automatically by the label or the content

prepare() None[source]

Prepare for writing to the image file.

Depending on the implementation, this calculates missing attributes (e.g. size) or even prepares a temporary file.

abstract write(out_file: BufferedIOBase)[source]

Writes this region to the current position in out_file

class embdgen.core.region.BaseContentRegion.BaseContentRegion[source]

Bases: BaseRegion

content: BaseContent
prepare() None[source]

Prepare for writing to the image file.

Depending on the implementation, this calculates missing attributes (e.g. size) or even prepares a temporary file.