Version: 9.12.0
deprecation
Collaboration diagram for deprecation:

Functions

def deprecation.deprecated (msg=msg_seedoc)
 This is a decorator which can be used to mark functions as deprecated. More...
 
def deprecation.deprecated_module (msg=msg_seedoc)
 This function can be used to mark a module as deprecated. More...
 
def deprecation.is_called_by_sphinx ()
 Determine if the calling code is ultimately called by sphinx to generate documentation. More...
 
def KERNEL_PY.kernel.deprecation.deprecated (msg=msg_seedoc)
 This is a decorator which can be used to mark functions as deprecated. More...
 
def KERNEL_PY.kernel.deprecation.deprecated_module (msg=msg_seedoc)
 This function can be used to mark a module as deprecated. More...
 
def KERNEL_PY.kernel.deprecation.is_called_by_sphinx ()
 Determine if the calling code is ultimately called by sphinx to generate documentation. More...
 

Detailed Description

This module provides several functions to indicate the deprecation of a module, a method or a function.

from salome.kernel.deprecation import deprecated
deprecated("Deprecated since version 6.3.0. Consider replacement with
newFunction()")
def oldFunction():
...
def deprecated(msg=msg_seedoc)
This is a decorator which can be used to mark functions as deprecated.
Definition: deprecation.py:74

Function Documentation

◆ deprecated() [1/2]

def deprecation.deprecated (   msg = msg_seedoc)

This is a decorator which can be used to mark functions as deprecated.

It will result in a warning being emitted when the function is used. The message in parameter will be displayed and should indicate how this function can be replaced. If the terminal can display colors, the warning messages will appear in blue.

References __deprecated_with_msg(), and is_called_by_sphinx().

◆ deprecated() [2/2]

def KERNEL_PY.kernel.deprecation.deprecated (   msg = msg_seedoc)

This is a decorator which can be used to mark functions as deprecated.

It will result in a warning being emitted when the function is used. The message in parameter will be displayed and should indicate how this function can be replaced. If the terminal can display colors, the warning messages will appear in blue.

This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the function is used. The message in parameter will
be displayed and should indicate how this function can be
replaced. If the terminal can display colors, the warning
messages will appear in blue.

References KERNEL_PY.kernel.deprecation.__deprecated_with_msg(), and KERNEL_PY.kernel.deprecation.is_called_by_sphinx().

◆ deprecated_module() [1/2]

def deprecation.deprecated_module (   msg = msg_seedoc)

This function can be used to mark a module as deprecated.

It must be called explicitly at the beginning of the deprecated module. It will result in a warning being emitted. The message in parameter will be displayed and should indicate how this module can be replaced. If the terminal can display colors, the warning messages will appear in blue.

References is_called_by_sphinx().

◆ deprecated_module() [2/2]

def KERNEL_PY.kernel.deprecation.deprecated_module (   msg = msg_seedoc)

This function can be used to mark a module as deprecated.

It must be called explicitly at the beginning of the deprecated module. It will result in a warning being emitted. The message in parameter will be displayed and should indicate how this module can be replaced. If the terminal can display colors, the warning messages will appear in blue.

This function can be used to mark a module as deprecated.
It must be called explicitly at the beginning of the deprecated
module. It will result in a warning being emitted. The message
in parameter will be displayed and should indicate how this
module can be replaced. If the terminal can display colors,
the warning messages will appear in blue.

References KERNEL_PY.kernel.deprecation.is_called_by_sphinx().

◆ is_called_by_sphinx() [1/2]

def deprecation.is_called_by_sphinx ( )

Determine if the calling code is ultimately called by sphinx to generate documentation.

The result can be used to conditionally inhibit the decorators or some Salome-related imports that fail when called outside Salome.

Referenced by deprecated(), and deprecated_module().

◆ is_called_by_sphinx() [2/2]

def KERNEL_PY.kernel.deprecation.is_called_by_sphinx ( )

Determine if the calling code is ultimately called by sphinx to generate documentation.

The result can be used to conditionally inhibit the decorators or some Salome-related imports that fail when called outside Salome.

Determine if the calling code is ultimately called by sphinx to generate
documentation. The result can be used to conditionally inhibit the
decorators or some Salome-related imports that fail when called outside
Salome.

Referenced by KERNEL_PY.kernel.deprecation.deprecated(), and KERNEL_PY.kernel.deprecation.deprecated_module().