post / templates /__init__.py
ex510's picture
Upload 3 files
ab4b623 verified
raw
history blame contribute delete
779 Bytes
"""
Template Registry
بيسجّل كل التمبلتس تلقائياً
لما تضيف تمبلت جديد — بس استورده هنا
"""
from .showcase_arabic import ShowcaseArabic
# from .showcase_dark import ShowcaseDark ← تمبلت جديد
# from .minimal_product import MinimalProduct ← تمبلت جديد
TEMPLATES = {
t.NAME: t
for t in [
ShowcaseArabic,
# ShowcaseDark,
# MinimalProduct,
]
}
def get_template(name: str):
cls = TEMPLATES.get(name)
if not cls:
available = list(TEMPLATES.keys())
raise ValueError(f"التمبلت '{name}' مش موجود. المتاح: {available}")
return cls()
def list_templates() -> list:
return [cls().info for cls in TEMPLATES.values()]