This script parse a directory tree looking for python modules and packages and create ReST files appropriately to create code documentation with Sphinx. It also create a modules index.
Check if there’s at least one class or one function in the module.
Create file name from base name, path and suffix
Build the text of the module file.
Build the text of the file
Format the excluded directory list. (verify that the path is not from the root of the volume or the root of the package)
Returns true if directory is in the exclude list otherwise returns false
returns True if directory is Python package - that is - contains the __index__.py file returns False otherwise
Parse and check the command line arguments
Create the module’s index.
Look for every file in the directory tree and create the corresponding ReST files.
goes through the list and discards names that match pattern for hidden and private directory and file names returns the list of those items that pass the “publicity” test
Return a list with only the python scripts (remove all other files).
returns list of subdimodule_name directories (only basenames) of package_path which are themselves python packages
Underline the title with the character pass, with the right length.
Create the automodule directive and add the options
Saves file for the module uses text_content for content and information within options to determine where to save
respects options “dry run” and “force”
Create the page heading.
Create the module subtitle