MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / wrapper

Function wrapper

Scripts/ButSystem.py:3063–3096  ·  view source on GitHub ↗

wrapper. Route handler or application helper. This docstring was expanded to make future maintenance easier. Args: *args: Parameter. **kwargs: Parameter. Returns: Varies.

(*args, **kwargs)

Source from the content-addressed store, hash-verified

3061
3062Internal helper function.
3063
3064This docstring was expanded to make future maintenance easier.
3065
3066Returns:
3067 Varies.
3068"""
3069 return {
3070 "lang": getattr(g, "lang", "en"),
3071 "logo_light": LOGO_LIGHT_URL,
3072 "logo_dark": LOGO_DARK_URL,
3073 "csrf_token": getattr(g, "csrf_token", csrf_token()),
3074 "csp_nonce": getattr(g, "csp_nonce", ""),
3075 "credit_line": CREDIT_LINE if "CREDIT_LINE" in globals() else WATERMARK,
3076 "ENABLE_CALLS": ENABLE_CALLS,
3077 }
3078
3079@app.route("/lang/toggle")
3080def toggle_language():
3081 """toggle_language.
3082
3083Route handler or application helper.
3084
3085This docstring was expanded to make future maintenance easier.
3086
3087Returns:
3088 Varies.
3089"""
3090 session["lang"] = "el" if get_lang() == "en" else "en"
3091 return redirect(request.referrer or (url_for("profiler") if is_logged_in() else url_for("index")))
3092
3093def _(s: str) -> str:
3094 """Translate a short UI string based on session language."""
3095 if get_lang() == "el":
3096 return TRANSLATIONS_EL.get(s, s)
3097 return s
3098
3099# Make _() available in all templates (optional direct use).

Callers

nothing calls this directly

Calls 3

is_logged_inFunction · 0.70
current_userFunction · 0.70
db_connectFunction · 0.70

Tested by

no test coverage detected