From 3a4dc52c21f81540a3ad927b6b2569d9c600af9d Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 25 Mar 2015 19:35:08 +0000 Subject: [PATCH] Add versionutils to API documentation Add an automodule directive for the new module. Clean up the existing docstring so it renders a bit more nicely. Update the usage page to refer to the new location of versionutils. Change-Id: Ib732509186e56ed2b39638129e2ec4272da1aa9d --- doc/source/api/versionutils.rst | 6 ++++++ doc/source/index.rst | 7 ++----- doc/source/usage.rst | 13 ++++--------- oslo_log/versionutils.py | 2 ++ 4 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 doc/source/api/versionutils.rst diff --git a/doc/source/api/versionutils.rst b/doc/source/api/versionutils.rst new file mode 100644 index 00000000..9be5a9c7 --- /dev/null +++ b/doc/source/api/versionutils.rst @@ -0,0 +1,6 @@ +======================= + oslo_log.versionutils +======================= + +.. automodule:: oslo_log.versionutils + :members: diff --git a/doc/source/index.rst b/doc/source/index.rst index ccaed936..15faff43 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -20,12 +20,9 @@ API Documentation .. toctree:: :maxdepth: 2 + :glob: - api/fixtures - api/formatters - api/handlers - api/helpers - api/log + api/* Indices and tables ================== diff --git a/doc/source/usage.rst b/doc/source/usage.rst index cb389b23..e544d3c0 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -71,15 +71,10 @@ Deprecation tools moved to ``versionutils`` ------------------------------------------- The :meth:`deprecated` decorator and :class:`DeprecatedConfig` have -moved to the :mod:`versionutils` module, which is still in the -oslo-incubator repository. Updating to use oslo.log may require -syncing a new version of :mod:`versionutils` at the same time, and -updating existing uses of those symbols. - -Replace ``LOG.deprecated()`` with -``versionutils.report_deprecated_feature()``, passing a local logger -object as the first argument so the log message includes the location -information. +moved to :mod:`oslo_log.versionutils`. Replace ``LOG.deprecated()`` +with :mod:`oslo_log.versionutils.report_deprecated_feature`, passing a +local logger object as the first argument so the log message includes +the location information. No more implicit conversion to unicode/str ------------------------------------------ diff --git a/oslo_log/versionutils.py b/oslo_log/versionutils.py index efc7904f..a92a783c 100644 --- a/oslo_log/versionutils.py +++ b/oslo_log/versionutils.py @@ -75,10 +75,12 @@ class deprecated(object): ... def c(): pass 4. Specifying the deprecated functionality will not be removed: + >>> @deprecated(as_of=deprecated.ICEHOUSE, remove_in=0) ... def d(): pass 5. Specifying a replacement, deprecated functionality will not be removed: + >>> @deprecated(as_of=deprecated.ICEHOUSE, in_favor_of='f()', remove_in=0) ... def e(): pass