utils
¶
get_live
¶
Get the live object, create one if not exists.
Source code in src/appl/core/utils.py
get_source_code
¶
make_panel
¶
make_panel(
content: str,
*,
title: Optional[str] = None,
style: StyleType = "none",
lexer: Optional[str] = None,
truncate: bool = False
) -> Panel
Display a panel in the terminal with the given title and content.
Source code in src/appl/core/utils.py
need_ctx
¶
partial
¶
Create a new function with partial application of the given arguments and keywords.
Source code in src/appl/core/utils.py
split_last
¶
Split the content at the last split marker, return content before and after the last marker.
If the split marker is not found in the content, return None and the original content.
Parameters:
-
content
(str
) –The content to split.
-
split_marker
(str
, default:'\n'
) –The marker to split the content at.
Returns:
-
Optional[str]
–A tuple of the content before and after the last marker.
-
str
–The first element could be None when the split marker is not found.
Source code in src/appl/core/utils.py
stop_live
¶
strip_for_continue
¶
Strip the content so that the last part is more informative to be matched.
wraps
¶
Replace the functools.wraps to take care of the type hint.