Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions logwrap/repr_utils.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ cdef:
cpdef int next_indent(self, unsigned int indent, unsigned int multiplier=?)

cdef:
str _repr_callable(self, src: typing.Union[types.FunctionType, types.MethodType], unsigned int indent=?)
str _repr_simple(self, src: typing.Any, unsigned int indent=?, bint no_indent_start=?)
str _repr_iterable_item(self, bint nl, str obj_type, str prefix, unsigned int indent, str result, str suffix)
str _repr_callable(self, src: typing.Union[types.FunctionType, types.MethodType], unsigned int indent=?) except *
str _repr_simple(self, src: typing.Any, unsigned int indent=?, bint no_indent_start=?) except *
str _repr_iterable_item(self, bint nl, str obj_type, str prefix, unsigned int indent, str result, str suffix) except *

cpdef str process_element(self, src: typing.Any, unsigned int indent=?, bint no_indent_start=?)

Expand Down
18 changes: 9 additions & 9 deletions logwrap/repr_utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ cdef class PrettyFormat:
return indent + multiplier * self.indent_step

cdef:
str _repr_callable(self, src: typing.Union[types.FunctionType, types.MethodType], unsigned int indent=0):
str _repr_callable(self, src: typing.Union[types.FunctionType, types.MethodType], unsigned int indent=0) except *:
"""Repr callable object (function or method).

:param src: Callable to process
Expand All @@ -181,7 +181,7 @@ cdef class PrettyFormat:
"""
raise NotImplementedError()

str _repr_simple(self, src: typing.Any, unsigned int indent=0, bint no_indent_start=False):
str _repr_simple(self, src: typing.Any, unsigned int indent=0, bint no_indent_start=False) except *:
"""Repr object without iteration.

:param src: Source object
Expand All @@ -195,7 +195,7 @@ cdef class PrettyFormat:
"""
raise NotImplementedError()

str _repr_iterable_item(self, bint nl, str obj_type, str prefix, unsigned int indent, str result, str suffix):
str _repr_iterable_item(self, bint nl, str obj_type, str prefix, unsigned int indent, str result, str suffix) except *:
"""Repr iterable item.

:param nl: newline before item
Expand Down Expand Up @@ -324,7 +324,7 @@ cdef class PrettyRepr(PrettyFormat):
prefix = "u"
return "{spc:<{indent}}{prefix}'''{string}'''".format(spc="", indent=indent, prefix=prefix, string=val)

str _repr_simple(self, src: typing.Any, unsigned int indent=0, bint no_indent_start=False):
str _repr_simple(self, src: typing.Any, unsigned int indent=0, bint no_indent_start=False) except *:
"""Repr object without iteration.

:param src: Source object
Expand All @@ -343,7 +343,7 @@ cdef class PrettyRepr(PrettyFormat):
return self._strings_repr(indent=indent, val=src)
return "{spc:<{indent}}{val!r}".format(spc="", indent=indent, val=src)

str _repr_callable(self, src: typing.Union[types.FunctionType, types.MethodType], unsigned int indent=0):
str _repr_callable(self, src: typing.Union[types.FunctionType, types.MethodType], unsigned int indent=0) except *:
"""Repr callable object (function or method).

:param src: Callable to process
Expand Down Expand Up @@ -380,7 +380,7 @@ cdef class PrettyRepr(PrettyFormat):
spc="", indent=indent, obj=src, args=param_str, annotation=annotation
)

str _repr_iterable_item(self, bint nl, str obj_type, str prefix, unsigned int indent, str result, str suffix):
str _repr_iterable_item(self, bint nl, str obj_type, str prefix, unsigned int indent, str result, str suffix) except *:
"""Repr iterable item.

:param nl: newline before item
Expand Down Expand Up @@ -450,7 +450,7 @@ cdef class PrettyStr(PrettyFormat):
val = val.decode(encoding="utf-8", errors="backslashreplace")
return "{spc:<{indent}}{string}".format(spc="", indent=indent, string=val)

str _repr_simple(self, src: typing.Any, unsigned int indent=0, bint no_indent_start=False):
str _repr_simple(self, src: typing.Any, unsigned int indent=0, bint no_indent_start=False) except *:
"""Repr object without iteration.

:param src: Source object
Expand All @@ -469,7 +469,7 @@ cdef class PrettyStr(PrettyFormat):
return self._strings_str(indent=indent, val=src)
return "{spc:<{indent}}{val!s}".format(spc="", indent=indent, val=src)

str _repr_callable(self, src: typing.Union[types.FunctionType, types.MethodType], unsigned int indent=0):
str _repr_callable(self, src: typing.Union[types.FunctionType, types.MethodType], unsigned int indent=0) except *:
"""Repr callable object (function or method).

:param src: Callable to process
Expand Down Expand Up @@ -506,7 +506,7 @@ cdef class PrettyStr(PrettyFormat):
spc="", indent=indent, obj=src, args=param_str, annotation=annotation
)

str _repr_iterable_item(self, bint nl, str obj_type, str prefix, unsigned int indent, str result, str suffix):
str _repr_iterable_item(self, bint nl, str obj_type, str prefix, unsigned int indent, str result, str suffix) except *:
"""Repr iterable item.

:param nl: newline before item
Expand Down