askbot.bin.generate_modules

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.

askbot.bin.generate_modules.check_for_code(module)

Check if there’s at least one class or one function in the module.

askbot.bin.generate_modules.create_file_name(base, opts)

Create file name from base name, path and suffix

askbot.bin.generate_modules.create_module_content(module)

Build the text of the module file.

askbot.bin.generate_modules.create_package_content(package, py_files, sub_packages)

Build the text of the file

askbot.bin.generate_modules.format_excludes(path, excludes)

Format the excluded directory list. (verify that the path is not from the root of the volume or the root of the package)

askbot.bin.generate_modules.is_directory_excluded(directory, excludes)

Returns true if directory is in the exclude list otherwise returns false

askbot.bin.generate_modules.is_python_package(path)

returns True if directory is Python package - that is - contains the __index__.py file returns False otherwise

askbot.bin.generate_modules.main()

Parse and check the command line arguments

askbot.bin.generate_modules.modules_toc(modules, opts, name='modules')

Create the module’s index.

askbot.bin.generate_modules.recurse_tree(path, excludes, opts)

Look for every file in the directory tree and create the corresponding ReST files.

askbot.bin.generate_modules.select_public_names(name_list)

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

askbot.bin.generate_modules.select_py_files(files)

Return a list with only the python scripts (remove all other files).

askbot.bin.generate_modules.select_python_packages(package_path, sub_directory_names)

returns list of subdimodule_name directories (only basenames) of package_path which are themselves python packages

askbot.bin.generate_modules.title_line(title, char)

Underline the title with the character pass, with the right length.

askbot.bin.generate_modules.write_automodule_directive(module)

Create the automodule directive and add the options

askbot.bin.generate_modules.write_file(module_name, text_content, opts)

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”

askbot.bin.generate_modules.write_heading(module, kind='Module')

Create the page heading.

askbot.bin.generate_modules.write_sub(module, kind='Module')

Create the module subtitle

This Page