mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
switch
This commit is contained in:
@@ -99,3 +99,11 @@ def check_any(arg: Any, name: str, validators: list[Callable[[Any], Any]]) -> An
|
||||
except Exception:
|
||||
pass
|
||||
raise_error(arg, name)
|
||||
|
||||
|
||||
# =====
|
||||
def filter_printable(arg: str, replace: str, limit: int) -> str:
|
||||
return "".join(
|
||||
(ch if ch.isprintable() else replace)
|
||||
for ch in arg[:limit]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user