Lines Matching refs:bytes

64     def _cache_hash(template: bytes) -> bytes:
109 _TagsByteTuple = tuple[bytes, bytes]
112 _CacheKey = tuple[typing.Union[bytes, int], bytes, bytes, bool]
120 _TagsByteTuple = typing.Tuple[bytes, bytes]
123 _CacheKey = typing.Tuple[typing.Union[bytes, int], bytes, bytes, bool]
135 TString = typing.TypeVar('TString', str, bytes)
136 """String/bytes generic."""
147 StringifyFunction = _abc.Callable[[bytes, bool], bytes]
150 EscapeFunction = _abc.Callable[[bytes], bytes]
295 """Tuple of default mustache tags (in bytes)."""
359 template: bytes,
366 :param template: template bytes
404 ) -> bytes:
406 Convert arbitrary data to bytes.
409 :param text: whether running in text mode or not (bytes mode)
410 :returns: template bytes
415 if isinstance(data, bytes) and not text else
447 def default_escape(data: bytes) -> bytes:
449 Convert bytes conflicting with HTML to their escape sequences.
451 :param data: bytes containing text
452 :returns: escaped text bytes
466 def default_resolver(name: typing.AnyStr) -> bytes:
471 :returns: empty bytes
561 Render given template to string/bytes.
564 :returns: rendered string or bytes (depending on template type)
572 def slicestrip(template: bytes, start: int, end: int) -> slice:
574 Strip slice from whitespace on bytes.
576 :param template: bytes where whitespace should be stripped
587 template: bytes,
599 :param template: template as utf-8 encoded bytes
782 ) -> _abc.Generator[bytes, int, None]:
789 :param resolver: callable will be used to resolve partials (bytes)
791 :param stringify: callable will be used to render python types (bytes)
792 :param escape: callable will be used to escape template (bytes)
806 data: bytes = (
843 bytes,
980 :param template: mustache template (str or bytes)
983 :param resolver: callable will be used to resolve partials (bytes)
985 :param stringify: callable will be used to render python types (bytes)
986 :param escape: callable will be used to escape template (bytes)
990 :returns: generator of bytes/str chunks (same type as template)
1035 :param resolver: callable will be used to resolve partials (bytes)
1037 :param stringify: callable will be used to render python types (bytes)
1038 :param escape: callable will be used to escape template (bytes)
1042 :returns: rendered bytes/str (type depends on template)