Rebrand sexp → sx across web platform (173 files)
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 11m37s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 11m37s
Rename all sexp directories, files, identifiers, and references to sx. artdag/ excluded (separate media processing DSL). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,9 +18,9 @@ from shared.infrastructure.urls import blog_url, market_url, cart_url, events_ur
|
||||
|
||||
|
||||
def _qs_filter_fn():
|
||||
"""Build a qs_filter(dict) wrapper for sexp components, or None.
|
||||
"""Build a qs_filter(dict) wrapper for sx components, or None.
|
||||
|
||||
Sexp components call ``qs_fn({"page": 2})``, ``qs_fn({"sort": "az"})``,
|
||||
Sx components call ``qs_fn({"page": 2})``, ``qs_fn({"sort": "az"})``,
|
||||
``qs_fn({"labels": ["organic", "local"]})``, etc.
|
||||
|
||||
Simple keys (page, sort, search, liked, clear_filters) are forwarded
|
||||
|
||||
@@ -28,9 +28,9 @@ from shared.browser.app.errors import errors
|
||||
|
||||
from .jinja_setup import setup_jinja
|
||||
from .user_loader import load_current_user
|
||||
from shared.sexp.jinja_bridge import setup_sexp_bridge
|
||||
from shared.sexp.components import load_shared_components
|
||||
from shared.sexp.relations import load_relation_registry
|
||||
from shared.sx.jinja_bridge import setup_sx_bridge
|
||||
from shared.sx.components import load_shared_components
|
||||
from shared.sx.relations import load_relation_registry
|
||||
|
||||
|
||||
# Async init of config (runs once at import)
|
||||
@@ -111,16 +111,16 @@ def create_base_app(
|
||||
register_db(app)
|
||||
register_redis(app)
|
||||
setup_jinja(app)
|
||||
setup_sexp_bridge(app)
|
||||
setup_sx_bridge(app)
|
||||
load_shared_components()
|
||||
load_relation_registry()
|
||||
|
||||
# Dev-mode: auto-reload sexp templates when files change on disk
|
||||
# Dev-mode: auto-reload sx templates when files change on disk
|
||||
if os.getenv("RELOAD") == "true":
|
||||
from shared.sexp.jinja_bridge import reload_if_changed
|
||||
from shared.sx.jinja_bridge import reload_if_changed
|
||||
|
||||
@app.before_request
|
||||
async def _sexp_hot_reload():
|
||||
async def _sx_hot_reload():
|
||||
reload_if_changed()
|
||||
errors(app)
|
||||
|
||||
|
||||
@@ -78,15 +78,15 @@ async def fetch_fragment(
|
||||
) -> str:
|
||||
"""Fetch a fragment from another app.
|
||||
|
||||
Returns an HTML string or a ``SexpExpr`` (when the provider responds
|
||||
with ``text/sexp``). When *required* is True (default), raises
|
||||
Returns an HTML string or a ``SxExpr`` (when the provider responds
|
||||
with ``text/sx``). When *required* is True (default), raises
|
||||
``FragmentError`` on network errors or non-200 responses.
|
||||
When *required* is False, returns ``""`` on failure.
|
||||
|
||||
Automatically returns ``""`` when called inside a fragment request
|
||||
to prevent circular dependencies between apps.
|
||||
"""
|
||||
from shared.sexp.parser import SexpExpr
|
||||
from shared.sx.parser import SxExpr
|
||||
|
||||
if _is_fragment_request():
|
||||
return ""
|
||||
@@ -102,8 +102,8 @@ async def fetch_fragment(
|
||||
)
|
||||
if resp.status_code == 200:
|
||||
ct = resp.headers.get("content-type", "")
|
||||
if "text/sexp" in ct:
|
||||
return SexpExpr(resp.text)
|
||||
if "text/sx" in ct:
|
||||
return SxExpr(resp.text)
|
||||
return resp.text
|
||||
msg = f"Fragment {app_name}/{fragment_type} returned {resp.status_code}"
|
||||
if required:
|
||||
|
||||
Reference in New Issue
Block a user