deprecation: deprecate the use of remove_route

This commit is contained in:
Yun Xu 2019-05-09 20:52:24 -07:00
parent 669cfa33df
commit d4ef151cc4

View File

@ -555,12 +555,20 @@ class Sanic:
This method provides the app user a mechanism by which an already This method provides the app user a mechanism by which an already
existing route can be removed from the :class:`Sanic` object existing route can be removed from the :class:`Sanic` object
.. warning::
remove_route is deprecated in v19.06 and will be removed from future versions.
:param uri: URL Path to be removed from the app :param uri: URL Path to be removed from the app
:param clean_cache: Instruct sanic if it needs to clean up the LRU :param clean_cache: Instruct sanic if it needs to clean up the LRU
route cache route cache
:param host: IP address or FQDN specific to the host :param host: IP address or FQDN specific to the host
:return: None :return: None
""" """
warnings.warn(
"remove_route is deprecated and will be removed from future versions.",
DeprecationWarning,
stacklevel=2,
)
self.router.remove(uri, clean_cache, host) self.router.remove(uri, clean_cache, host)
# Decorator # Decorator