fqn_decorators

fqn_decorators.async module

fqn_decorators.decorators module

class fqn_decorators.decorators.ChainedDecorator(func=None, decorators=None, **params)

Bases: fqn_decorators.decorators.Decorator

Simple decorator which allows you to combine regular decorators and decorators based on Decorator. It will preserve the FQN for those based on Decorator.

before()

Allow performing an action before the function is called.

class fqn_decorators.decorators.Decorator(func=None, **params)

Bases: object

A base class to easily create decorators.

after()

Allow performing an action after the function is called.

args = None

The non-keyworded arguments with which the callable will be called

before()

Allow performing an action before the function is called.

exc_info = None

Exception information in case of an exception

exception()

Allow exception processing (note that the exception will still be raised after processing.

fqn = None

The fully qualified name of the callable

func = None

The callable that is being decorated

get_fqn()

Allow overriding the fqn and also change functionality to determine fqn.

kwargs = None

The keyword arguments with which the callable will be called

params = None

The keyword arguments provided to the decorator on init

result = None

The result of the execution of the callable

fqn_decorators.decorators.chained_decorator

alias of fqn_decorators.decorators.ChainedDecorator

fqn_decorators.decorators.get_fqn(obj)

This function tries to determine the fully qualified name (FQN) of the callable that is provided. It only works for classes, methods and functions. It is unable to properly determine the FQN of class instances, static methods and class methods.