Move render functions, layouts, helpers, and utils from __init__.py to sub-modules (renders.py, layouts.py, helpers.py, utils.py). Update all bp route imports to point at sub-modules directly. Each __init__.py is now ≤20 lines of setup + registration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21 lines
672 B
Python
21 lines
672 B
Python
"""Federation defpage setup — registers layouts and loads .sx pages."""
|
|
from __future__ import annotations
|
|
|
|
|
|
def setup_federation_pages() -> None:
|
|
"""Register federation-specific layouts and load page definitions."""
|
|
_register_federation_layouts()
|
|
_load_federation_page_files()
|
|
|
|
|
|
def _load_federation_page_files() -> None:
|
|
import os
|
|
from shared.sx.pages import load_page_dir
|
|
load_page_dir(os.path.dirname(__file__), "federation")
|
|
|
|
|
|
def _register_federation_layouts() -> None:
|
|
from shared.sx.layouts import register_custom_layout
|
|
from .utils import _social_full, _social_oob
|
|
register_custom_layout("social", _social_full, _social_oob)
|