Functions
_editor_url
2
str | None
▼
Build a clickable editor URL from CHIRP_EDITOR env var.
Supports preset names …
_editor_url
2
str | None
▼
def _editor_url(filepath: str, lineno: int) -> str | None
Build a clickable editor URL from CHIRP_EDITOR env var.
Supports preset names (vscode, cursor, sublime, textmate,
idea, pycharm) or custom patterns with __FILE__ / __LINE__
placeholders.
ReturnsNone if CHIRP_EDITORis not set.
Parameters
| Name | Type | Description |
|---|---|---|
filepath |
str |
|
lineno |
int |
Returns
str | None
_is_app_frame
1
bool
▼
True if the frame is from the application (not stdlib/site-packages).
_is_app_frame
1
bool
▼
def _is_app_frame(filename: str) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
filename |
str |
Returns
bool
_extract_frames
1
list[dict[str, Any]]
▼
Walk a traceback and extract frame info with source context and locals.
_extract_frames
1
list[dict[str, Any]]
▼
def _extract_frames(tb: types.TracebackType | None) -> list[dict[str, Any]]
Parameters
| Name | Type | Description |
|---|---|---|
tb |
types.TracebackType | None |
Returns
list[dict[str, Any]]
_extract_template_context
1
dict[str, Any] | None
▼
Extract rich context from kida template exceptions.
Returns a dict with templa…
_extract_template_context
1
dict[str, Any] | None
▼
def _extract_template_context(exc: BaseException) -> dict[str, Any] | None
Extract rich context from kida template exceptions.
Returns a dict with template-specific error info, or None if the exception is not a kida template error.
Parameters
| Name | Type | Description |
|---|---|---|
exc |
BaseException |
Returns
dict[str, Any] | None
_extract_request_context
1
dict[str, Any]
▼
Extract displayable request context from a chirp Request.
_extract_request_context
1
dict[str, Any]
▼
def _extract_request_context(request: Any) -> dict[str, Any]
Parameters
| Name | Type | Description |
|---|---|---|
request |
Any |
Returns
dict[str, Any]
_esc
1
str
▼
HTML-escape a string.
_esc
1
str
▼
def _esc(text: str) -> str
Parameters
| Name | Type | Description |
|---|---|---|
text |
str |
Returns
str
_render_source_lines
2
str
▼
Render source lines with error highlighting.
_render_source_lines
2
str
▼
def _render_source_lines(source_lines: list[tuple[int, str]], error_lineno: int) -> str
Parameters
| Name | Type | Description |
|---|---|---|
source_lines |
list[tuple[int, str]] |
|
error_lineno |
int |
Returns
str
_render_locals
1
str
▼
Render local variables panel.
_render_locals
1
str
▼
def _render_locals(local_vars: dict[str, str]) -> str
Parameters
| Name | Type | Description |
|---|---|---|
local_vars |
dict[str, str] |
Returns
str
_render_frame
1
str
▼
Render a single traceback frame.
_render_frame
1
str
▼
def _render_frame(frame: dict[str, Any]) -> str
Parameters
| Name | Type | Description |
|---|---|---|
frame |
dict[str, Any] |
Returns
str
_render_template_panel
1
str
▼
Render the kida template error panel.
_render_template_panel
1
str
▼
def _render_template_panel(ctx: dict[str, Any]) -> str
Parameters
| Name | Type | Description |
|---|---|---|
ctx |
dict[str, Any] |
Returns
str
_render_request_panel
1
str
▼
Render request context panel.
_render_request_panel
1
str
▼
def _render_request_panel(request: Any) -> str
Parameters
| Name | Type | Description |
|---|---|---|
request |
Any |
Returns
str
render_debug_page
3
str
▼
Render a rich debug error page.
render_debug_page
3
str
▼
def render_debug_page(exc: BaseException, request: Any, *, is_fragment: bool = False) -> str
Parameters
| Name | Type | Description |
|---|---|---|
exc |
BaseException |
The exception that caused the error. |
request |
Any |
The chirp Request object. |
is_fragment |
bool |
If True, render a compact fragment instead of a full page. Default:False
|
Returns
str