diff --git a/README.md b/README.md index ce43e57..badd3f2 100644 --- a/README.md +++ b/README.md @@ -146,3 +146,25 @@ If your commit fails its either: branch name != /description-of-branch , commit name != : description of the commit. : N25B-Num's + +## Documentation +Generate documentation web pages using: + +```bash +PYTHONPATH=src sphinx-apidoc -F -o docs src/robot_interface +``` + +Optionally, in the `conf.py` file in the new `docs` folder, change preferences. +For the page theme, change `html_theme` to `'sphinx_rtd_theme'`. + +In the `docs` folder: + +### Windows +```bash +.\make.bat html +``` + +### MacOS +```bash +make html +``` \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index f93c70d..c7e1990 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,5 @@ pyaudio<=0.2.11 pytest<5 pytest-mock<3.0.0 pytest-cov<3.0.0 +sphinx +sphinx_rtd_theme \ No newline at end of file diff --git a/src/robot_interface/state.py b/src/robot_interface/state.py index b6f8ce1..cae3ce6 100644 --- a/src/robot_interface/state.py +++ b/src/robot_interface/state.py @@ -45,7 +45,13 @@ class State(object): def __getattribute__(self, name): # Enforce that the state is initialized before accessing any property (aside from the basic ones) - if name in ("initialize", "deinitialize", "is_initialized", "__dict__", "__class__"): + if name in ( + "initialize", + "deinitialize", + "is_initialized", + "__dict__", + "__class__", + "__doc__"): return object.__getattribute__(self, name) if not object.__getattribute__(self, "is_initialized"):