Package mrv :: Package doc :: Module base :: Class DocGenerator
[hide private]
[frames] | no frames]

Class DocGenerator

source code

object --+
         |
        DocGenerator

Encapsulates all functionality required to create sphinx/epydoc documentaiton
Instance Methods [hide private]
 
__init__(self, sphinx=True, sphinx_autogen=True, coverage=True, epydoc=True, base_dir='.', *args)
Initialize the instance
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Public Interface
 
generate(self)
Geneate the documentation according to our configuration
source code
 
clean(self)
Clean the generated files by removing them :note: Must respect the options the same way as done by the generate method
source code
    Paths
 
base_dir(self)
Returns: Path containing all documentation sources and output files
source code
 
set_base_dir(self, base_dir)
Set the base directory to the given value :return: self
source code
 
index_rst_path(self)
Returns: Path to index rst file
source code
 
build_downloads_dir(self)
Returns: Path to the build downloads directory
source code
 
source_downloads_dir(self)
Returns: Path to the source downloads directory
source code
 
source_downloads_coverage_dir(self)
Returns: Path to coverage related downloads
source code
 
epydoc_target_dir(self)
Returns: Path to directory to which epydoc will write its output
source code
 
html_output_dir(self)
Returns: html directory to receive all output
source code
 
autogen_output_dir(self)
Returns: directory to which sphinx-autogen will write its output to
source code
 
doctrees_dir(self)
Returns: Path to doctrees directory to which sphinx writes some files
source code
 
mrv_bin_path(self)
Returns: Path to mrv binary
source code
 
tmrv_bin_path(self)
Returns: Path to tmrv binary
source code
    Utilities
 
_mrv_maya_version(self)
Returns: maya version with which mrv subcommands should be started with
source code
 
_call_python_script(self, *args, **kwargs)
Wrapper of subprocess.call which assumes that we call a python script.
source code
    Protected Interface
 
_make_sphinx_index(self)
Generate the index.rst file according to the modules and packages we actually have
source code
 
_make_coverage(self)
Generate a coverage report and make it available as download
source code
 
_make_sphinx_autogen(self)
Instruct sphinx to generate the autogen rst files
source code
 
_sphinx_args(self)
Returns: list of arguments to be used when calling sphinx from the commandline
source code
 
_make_sphinx(self)
Generate the sphinx documentation
source code
 
_make_epydoc(self)
Generate epydoc documentation
source code
Class Methods [hide private]
 
_apply_epydoc_config(cls)
Read package info configuration and apply it
source code
    Public Interface
 
remove_version_info(cls, idstring, basedir='.')
Remove the version info file if it exists
source code
 
version_file_name(cls, idstring, basedir='.')
Returns: filename at which to write the version file with the given id
source code
 
write_version(cls, idstring, basedir='.')
Writes a version file containing the rootmodule's version info.
source code
 
check_version(cls, opid, idstring, basedir='.')
Checks whether the current version info matches with the stored version info as retrieved from idstring.
source code
 
parser(cls)
with which to initialize our instance
source code
 
root_dir(cls, basedir='.')
Returns: path which includes our package - if it would be in the sys.path, we should be able to import it
source code
 
makedoc(cls, args)
Produce the actual docs using this type
source code
    Protected Interface
 
_retrieve_project_info(cls, base_dir='.')
Store the project information of the actual project in our class members for later use :note: must be called exactly once
source code
Class Variables [hide private]
    Configuration
  forbidden_dirs = ['test', 'ext', 'doc', '.']
  source_dir = Path('source')
  source_dl_dir = Path('source/download')
  build_dir = Path('build')
  html_dir = Path('build/html')
  downloads_dir = Path('build/html/_downloads')
  epydoc_show_source = 'yes'
  epydoc_modules = 'modules: unittest,../mrv'
  epydoc_exclude = 'mrv.test,mrv.cmd.ipythonstartup'
  package_name = 'mrv'
  pinfo
Provide project related global information.
  rootmodule
Initialize mrv system assisting development, debugging and maintenance
  epydoc_cfg = '[epydoc]\nname: mrv\nurl: https://github.com/Byr...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, sphinx=True, sphinx_autogen=True, coverage=True, epydoc=True, base_dir='.', *args)
(Constructor)

source code 
Initialize the instance
Parameters:
  • sphinx - If True, sphinx documentation will be produced
  • coverage - If True, the coverage report will be generated
  • epydoc - If True, epydoc documentation will be generated
Overrides: object.__init__

version_file_name(cls, idstring, basedir='.')
Class Method

source code 
Returns:
filename at which to write the version file with the given id

write_version(cls, idstring, basedir='.')
Class Method

source code 
Writes a version file containing the rootmodule's version info. This allows to verify that the version of the individual parts, like epydoc and sphinx are still matching

check_version(cls, opid, idstring, basedir='.')
Class Method

source code 
Checks whether the current version info matches with the stored version info as retrieved from idstring. If there is no such info or if the version matches exactly, do nothing. Otherwise raise an environment error to tell the user to rebuild the respective part of the documentation

parser(cls)
Class Method

source code 
with which to initialize our instance
Returns:
OptionParser instance suitable to parse commandline arguments

root_dir(cls, basedir='.')
Class Method

source code 
Parameters:
  • basedir - we expect to be in the root/doc path of the project - if this is not the case, the basedir can be adjusted accordingly to 'virtually' chdir into the doc directory
Returns:
path which includes our package - if it would be in the sys.path, we should be able to import it

generate(self)

source code 
Geneate the documentation according to our configuration

Note: respects the options given during construction

base_dir(self)

source code 
Returns:
Path containing all documentation sources and output files

index_rst_path(self)

source code 
Returns:
Path to index rst file

build_downloads_dir(self)

source code 
Returns:
Path to the build downloads directory

source_downloads_dir(self)

source code 
Returns:
Path to the source downloads directory

source_downloads_coverage_dir(self)

source code 
Returns:
Path to coverage related downloads

epydoc_target_dir(self)

source code 
Returns:
Path to directory to which epydoc will write its output

html_output_dir(self)

source code 
Returns:
html directory to receive all output

autogen_output_dir(self)

source code 
Returns:
directory to which sphinx-autogen will write its output to

doctrees_dir(self)

source code 
Returns:
Path to doctrees directory to which sphinx writes some files

mrv_bin_path(self)

source code 
Returns:
Path to mrv binary

tmrv_bin_path(self)

source code 
Returns:
Path to tmrv binary

_mrv_maya_version(self)

source code 
Returns:
maya version with which mrv subcommands should be started with

_call_python_script(self, *args, **kwargs)

source code 
Wrapper of subprocess.call which assumes that we call a python script. On windows, the python interpreter needs to be called directly :raise EnvironmentError: if the called had a non-0 return value

_sphinx_args(self)

source code 
Returns:
list of arguments to be used when calling sphinx from the commandline

Note: directories of all kinds will be handled by the caller


Class Variable Details [hide private]

pinfo

Provide project related global information.

:note: Importing this module must not have any side effects !

Value:
mrv.info

rootmodule

Initialize mrv system assisting development, debugging and maintenance

  • install general `decorator` into __builtin__ namespace
Value:
mrv

epydoc_cfg

Value:
'''[epydoc]
name: mrv
url: https://github.com/Byron/mrv

sourcecode: yes
modules: unittest,../mrv

exclude: mrv.test,mrv.cmd.ipythonstartup
...