Skip to content
Merged
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
10 changes: 5 additions & 5 deletions doc/source/PrettyFormat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ API: Helpers: `pretty_repr`, `pretty_str` and base class `PrettyFormat`.

:param src: object to process
:type src: typing.Union[
six.binary_type, six.text_type, int, typing.Iterable, object
typing.AnyStr, int, typing.Iterable, object
]
:param indent: start indentation, all next levels is +indent_step
:type indent: int
Expand All @@ -36,7 +36,7 @@ API: Helpers: `pretty_repr`, `pretty_str` and base class `PrettyFormat`.

:param src: object to process
:type src: typing.Union[
six.binary_type, six.text_type, int, typing.Iterable, object
typing.AnyStr, int, typing.Iterable, object
]
:param indent: start indentation, all next levels is +indent_step
:type indent: int
Expand Down Expand Up @@ -90,23 +90,23 @@ API: Helpers: `pretty_repr`, `pretty_str` and base class `PrettyFormat`.

:param src: object to process
:type src: typing.Union[
six.binary_type, six.text_type, int, typing.Iterable, object
typing.AnyStr, int, typing.Iterable, object
]
:param indent: start indentation
:type indent: int
:param no_indent_start:
do not indent open bracket and simple parameters
:type no_indent_start: bool
:return: formatted string
:rtype: six.text_type
:rtype: typing.Text

.. py:method:: __call__(src, indent=0, no_indent_start=False)

Make human readable representation of object. The main entry point.

:param src: object to process
:type src: typing.Union[
six.binary_type, six.text_type, int, typing.Iterable, object
typing.AnyStr, int, typing.Iterable, object
]
:param indent: start indentation
:type indent: int
Expand Down
4 changes: 2 additions & 2 deletions doc/source/logwrap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ API: Decorators: `LogWrap` class and `logwrap` function.
:param arg: bound parameter
:type arg: BoundParameter
:param arg_repr: repr for value
:type arg_repr: six.text_type
:type arg_repr: typing.Text
:return: processed repr for value
:rtype: six.text_type
:rtype: typing.Text

Override this method if some modifications required for result of repr() over parameter

Expand Down
22 changes: 6 additions & 16 deletions logwrap/_log_wrap2.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,11 @@ def __init__( # pylint: disable=keyword-arg-before-vararg
signature with decorated function, or arguments bind
will be failed!
:type spec: typing.Optional[typing.Callable]
:param blacklisted_names: Blacklisted argument names.
Arguments with this names will be skipped
in log.
:param blacklisted_names: Blacklisted argument names. Arguments with this names will be skipped in log.
:type blacklisted_names: typing.Optional[typing.Iterable[str]]
:param blacklisted_exceptions: list of exception,
which should be re-raised without
producing log record.
:type blacklisted_exceptions: typing.Optional[
typing.Iterable[Exception]
]
:param log_call_args: log call arguments before executing
wrapped function.
:param blacklisted_exceptions: list of exception, which should be re-raised without producing log record.
:type blacklisted_exceptions: typing.Optional[typing.Iterable[Exception]]
:param log_call_args: log call arguments before executing wrapped function.
:type log_call_args: bool
:param log_call_args_on_exc: log call arguments if exception raised.
:type log_call_args_on_exc: bool
Expand Down Expand Up @@ -192,12 +185,9 @@ def logwrap( # pylint: disable=keyword-arg-before-vararg
Note: this object should provide fully compatible signature
with decorated function, or arguments bind will be failed!
:type spec: typing.Optional[typing.Callable]
:param blacklisted_names: Blacklisted argument names.
Arguments with this names will be skipped in log.
:param blacklisted_names: Blacklisted argument names. Arguments with this names will be skipped in log.
:type blacklisted_names: typing.Optional[typing.List[str]]
:param blacklisted_exceptions: list of exception,
which should be re-raised without
producing log record.
:param blacklisted_exceptions: list of exception, which should be re-raised without producing log record.
:type blacklisted_exceptions: typing.Optional[typing.List[Exception]]
:param log_call_args: log call arguments before executing wrapped function.
:type log_call_args: bool
Expand Down
12 changes: 6 additions & 6 deletions logwrap/_log_wrap_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,16 +510,16 @@ def pre_process_param( # pylint: disable=no-self-use
def post_process_param( # pylint: disable=no-self-use,unused-argument
self,
arg, # type: BoundParameter
arg_repr # type: six.text_type
): # type: (...) -> six.text_type
arg_repr # type: typing.Text
): # type: (...) -> typing.Text
"""Process parameter for the future logging.

:param arg: bound parameter
:type arg: BoundParameter
:param arg_repr: repr for value
:type arg_repr: six.text_type
:type arg_repr: typing.Text
:return: processed repr for value
:rtype: six.text_type
:rtype: typing.Text

Override this method if some modifications required for result of repr() over parameter

Expand All @@ -532,13 +532,13 @@ def _get_func_args_repr(
sig, # type: inspect.Signature
args, # type: typing.Tuple
kwargs # type: typing.Dict[str, typing.Any]
): # type: (...) -> six.text_type
): # type: (...) -> typing.Text
"""Internal helper for reducing complexity of decorator code.

:type sig: inspect.Signature
:type args: tuple
:type kwargs: dict
:rtype: str
:rtype: typing.Text

.. versionchanged:: 3.3.0 Use pre- and post- processing of params during execution
"""
Expand Down
6 changes: 3 additions & 3 deletions logwrap/_log_wrap_shared.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ class BaseLogWrap(_class_decorator.BaseDecorator):
def post_process_param(
self,
arg: BoundParameter,
arg_repr: six.text_type
) -> six.text_type: ...
arg_repr: typing.Text
) -> typing.Text: ...

def _get_func_args_repr(
self,
sig: inspect.Signature,
args: typing.Tuple,
kwargs: typing.Dict[str, typing.Any]
) -> six.text_type: ...
) -> typing.Text: ...

def _make_done_record(
self,
Expand Down
Loading