mirror of
https://github.com/BigfootACA/arch-image-builder.git
synced 2024-11-15 01:43:25 +08:00
28 lines
649 B
Python
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)
|