From 3a7fca5e9dc02ae605ebd8d53ebc5b16eadee771 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Mon, 13 Apr 2015 09:00:39 -0700 Subject: [PATCH] Add missing reflection + uuidutils docs These do not seem to have been created and made appear, so make them appear and make sure the exposed public API(s) have docstrings so that they appear in the generated docs. Change-Id: Ie34e46647b0b20d936ddaa15dc824d0e2d2ca99d --- doc/source/api/reflection.rst | 6 ++++++ doc/source/api/uuidutils.rst | 6 ++++++ doc/source/index.rst | 2 ++ oslo_utils/reflection.py | 3 ++- oslo_utils/uuidutils.py | 4 ++++ 5 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 doc/source/api/reflection.rst create mode 100644 doc/source/api/uuidutils.rst diff --git a/doc/source/api/reflection.rst b/doc/source/api/reflection.rst new file mode 100644 index 00000000..fc11d2ba --- /dev/null +++ b/doc/source/api/reflection.rst @@ -0,0 +1,6 @@ +============ + reflection +============ + +.. automodule:: oslo_utils.reflection + :members: diff --git a/doc/source/api/uuidutils.rst b/doc/source/api/uuidutils.rst new file mode 100644 index 00000000..f1d03e94 --- /dev/null +++ b/doc/source/api/uuidutils.rst @@ -0,0 +1,6 @@ +=========== + uuidutils +=========== + +.. automodule:: oslo_utils.uuidutils + :members: diff --git a/doc/source/index.rst b/doc/source/index.rst index 62980267..7c5dcd27 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -25,9 +25,11 @@ API Documentation api/fixture api/importutils api/netutils + api/reflection api/strutils api/timeutils api/units + api/uuidutils Indices and tables ================== diff --git a/oslo_utils/reflection.py b/oslo_utils/reflection.py index b964cf34..02f0c30a 100644 --- a/oslo_utils/reflection.py +++ b/oslo_utils/reflection.py @@ -130,6 +130,7 @@ def get_callable_name(function): def get_method_self(method): + """Gets the ``self`` object attached to this method (or none).""" if not inspect.ismethod(method): return None try: @@ -187,7 +188,7 @@ def _get_arg_spec(function): def get_callable_args(function, required_only=False): """Get names of callable arguments. - Special arguments (like *args and **kwargs) are not included into + Special arguments (like ``*args`` and ``**kwargs``) are not included into output. If required_only is True, optional arguments (with default values) diff --git a/oslo_utils/uuidutils.py b/oslo_utils/uuidutils.py index 62b0b5f4..c7cc5870 100644 --- a/oslo_utils/uuidutils.py +++ b/oslo_utils/uuidutils.py @@ -21,6 +21,10 @@ import uuid def generate_uuid(): + """Creates a random uuid string. + + :returns: string + """ return str(uuid.uuid4())