djblets.deprecation¶
Internal support for handling deprecations in Djblets.
The version-specific objects in this module are not considered stable between releases, and may be removed at any point. The base objects are considered stable.
-
exception
BaseRemovedInDjbletsVersionWarning
[source]¶ Bases:
exceptions.DeprecationWarning
Base class for a Djblets deprecation warning.
All version-specific deprecation warnings inherit from this, allowing callers to check for Djblets deprecations without being tied to a specific version.
-
exception
RemovedInDjblets20Warning
[source]¶ Bases:
djblets.deprecation.BaseRemovedInDjbletsVersionWarning
Deprecations for features removed in Djblets 2.0.
Note that this class will itself be removed in Djblets 2.0. If you need to check against Djblets deprecation warnings, please see
BaseRemovedInDjbletsVersionWarning
. Alternatively, you can use the alias for this class,RemovedInNextDjbletsVersionWarning
.
-
RemovedInNextDjbletsVersionWarning
[source]¶ An alias for the next release of Djblets where features would be removed.
-
deprecated_arg_value
(owner_name, value, old_arg_name, new_arg_name=None, warning_cls=<type 'exceptions.DeprecationWarning'>)[source]¶ Wrap a value in a lazy object to warn when used.
Parameters: - owner_name (unicode) – The name of the owner of this argument.
- value (object) – The argument value.
- old_arg_name (unicode) – The name of the argument that was deprecated.
- new_arg_name (unicode, optional) – The optional name of the argument to use in the deprecated argument’s place, if one is available.
- warning_cls (type, optional) – The class to use for the warning. This should be
DeprecationWarning
,PendingDeprecationWarning
, or a subclass of one.
Returns: The value wrapped in a lazy object. The first time it is accessed, a warning will be emitted.
Return type: django.utils.functional.SimpleLazyObject