arch-image-builder/builder/disk/content.py
BigfootACA e6c6ab6bf7 Initial commit
Signed-off-by: BigfootACA <bigfoot@classfun.cn>
2024-05-17 23:04:34 +08:00

28 lines
649 B
Python

from builder.disk.image import ImageBuilder
class ImageContentBuilder:
builder: ImageBuilder
properties: dict
def __init__(self, builder: ImageBuilder):
self.builder = builder
self.properties = {}
def build(self): pass
class ImageContentBuilders:
types: list[tuple[str, type[ImageContentBuilder]]] = []
@staticmethod
def init():
if len(ImageContentBuilders.types) > 0: return
from builder.disk.types import types
ImageContentBuilders.types.extend(types)
@staticmethod
def find_builder(name: str) -> type[ImageContentBuilder]:
types = ImageContentBuilders.types
return next((t[1] for t in types if name == t[0]), None)