Пример #1
0
def tryread_def(path: Path, default: str) -> str:
    return trycatch(partial(readstr, path=path), default, lambda x: x)
Пример #2
0
def tryread(path: Path) -> Optional[str]:
    none: Optional[str] = None
    return trycatch(partial(readstr, path=path), none, lambda x: x)
Пример #3
0
def tryreadjson_def(json_path: str, default: Any) -> Any:
    return trycatch(partial(readjson, json_path=json_path), default,
                    lambda x: x)
Пример #4
0
def maybereadstr(path: str, default: str, mp: Callable[[str], D]) -> D:
    return trycatch(partial(readstr, path=path), default, mp)
Пример #5
0
def maybereadjson(path: str, default: Any, mp: Callable[[Any], C]) -> C:
    return trycatch(partial(readjson, json_path=path), default, mp)
Пример #6
0
def tryreadjson(json_path: str) -> Optional[Any]:
    none: Optional[Any] = None
    return trycatch(partial(readjson, json_path=json_path), none, lambda x: x)