diff --git a/py/docs/source/index.rst b/py/docs/source/index.rst index c61c77977796a..112a17f959936 100644 --- a/py/docs/source/index.rst +++ b/py/docs/source/index.rst @@ -23,7 +23,7 @@ The `selenium` package is used to automate web browser interaction from Python. | **API Docs**: | `api.html `_ | +-------------------+------------------------------------------------+ -Updated documentation published with each commit is available at: https://selenium-python-api-docs.readthedocs.io +Updated documentation published with each commit is available at: `readthedocs.io `_ ---- diff --git a/py/generate_api_module_listing.py b/py/generate_api_module_listing.py index b2168545bda3d..90408f823a86f 100644 --- a/py/generate_api_module_listing.py +++ b/py/generate_api_module_listing.py @@ -15,13 +15,13 @@ # specific language governing permissions and limitations # under the License. -# ----------------------------------------------------------------- -# This script recursively scans the `selenium` package directory -# to find all modules, then generates the `py/docs/source/api.rst` -# file containing a listing of all modules in separate sections. -# The `api.rst` file is later used by `sphinx-autogen` to generate -# sphinx autodoc stub pages used in the Python API documentation. -# See `py/tox.ini` for how it is invoked. + +"""This script recursively scans the `selenium` package directory +to find all modules, then generates the `py/docs/source/api.rst` +file containing a listing of all modules in separate sections. +The `api.rst` file is later used by `sphinx-autogen` to generate +sphinx autodoc stub pages used in the Python API documentation. +See `py/tox.ini` for how it is invoked.""" import os import site @@ -47,8 +47,8 @@ def find_modules(package_name): package_name = "selenium" output_file = os.path.join("docs", "source", "api.rst") print(f"generating module list for sphinx autodoc in: {output_file}\n") - modules = find_modules(package_name) - base_modules = [mod for mod in sorted(set(module.rsplit(".", 1)[0] for module in modules)) if mod != package_name] + modules = [module for module in find_modules(package_name) if ".devtools." not in module] + base_modules = [mod for mod in sorted({module.rsplit(".", 1)[0] for module in modules}) if mod != package_name] print("found sections:") for base_module in base_modules: print(f" {base_module}")