Version: 8.3.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
deprecation

Functions

def deprecation.deprecated
 This is a decorator which can be used to mark functions as deprecated. More...
 
def deprecation.deprecated_module
 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...
 

Detailed Description

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

1 from salome.kernel.deprecation import deprecated
2 deprecated("Deprecated since version 6.3.0. Consider replacement with
3  newFunction()")
4 def oldFunction():
5 ...

Function Documentation

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.

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.

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.