ó 1Tc@sÎdZddlZddlZddlZddlZddlZddlmZmZddl m Z ddl m Z ddl mZmZddlmZddlmZdd lmZdd lmZmZmZmZmZmZmZmZmZeeƒeeƒeeƒeeƒeeƒeeƒeeƒeeƒej d „Z!d „Z"d „Z#dde#e"dddd„Z%d„Z&ddd„Z'ddd„Z(e)dkrÊe!ƒndS(s" sphinx.ext.autosummary.generate ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Usable as a library or script to generate automatic RST source files for items referred to in autosummary:: directives. Each generated RST file contains a single auto*:: directive which extracts the docstring of the referred item. Example Makefile rule:: generate: sphinx-autogen -o source/generated source/*.rst :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. iÿÿÿÿN(tFileSystemLoadertTemplateNotFound(tSandboxedEnvironment(t package_dir(timport_by_nametget_documenter(tBuiltinTemplateLoader(t ensuredir(t safe_getattr( tadd_documentertModuleDocumentertClassDocumentertExceptionDocumentertDataDocumentertFunctionDocumentertMethodDocumentertAttributeDocumentertInstanceAttributeDocumenterc Csd}tj|jƒƒ}|jdddddddd d dd d ƒ|jd dddddddd dd dƒ|jddddddddd dd dƒ|j|dƒ\}}t|ƒdkrà|jdƒnt||j d|j d|j ƒdS(Ns%prog [OPTIONS] SOURCEFILE ...s-os --output-dirtactiontstorettypetstringtdestt output_dirtdefaultthelps Directory to place all output ins-ss--suffixtsuffixtrsts,Default suffix for files (default: %default)s-ts --templatest templatess-Custom template directory (default: %default)isno input files givent.t template_dir( toptparset OptionParsertstript add_optiontNonet parse_argstlenterrortgenerate_autosummary_docsRRR(targvtusagetptoptionstargs((sI/usr/local/lib/python2.7/site-packages/sphinx/ext/autosummary/generate.pytmain3s"     cCs |GHdS(N((tmsg((sI/usr/local/lib/python2.7/site-packages/sphinx/ext/autosummary/generate.pyt _simple_infoHscCstjd|IJdS(Ns WARNING: (tsyststderr(R.((sI/usr/local/lib/python2.7/site-packages/sphinx/ext/autosummary/generate.pyt _simple_warnKss.rstc!CsÛtt|ƒƒ}t|ƒdkr@|d dg|d}n|ddj|ƒƒ|rn|d|ƒn|dk r¥g|D]} tjj|| ƒ^q}ntjjtdd d ƒg} |dk rîtƒ} | j |d | ƒn%|r| j d |ƒnt | ƒ} t d | ƒ} t |ƒ} tg| D]}|tf^q8ƒjƒ} g}x8t| dtƒD]$\}}}|dkr“qrn|p¨tjj|ƒ}t|ƒyt|ƒ\}}}}Wn*tk rý}|d||fƒqrnXtjj|||ƒ}tjj|ƒr/qrn|j|ƒt|dƒ}z=t||ƒ}|dk r{| j|ƒ}n=y| jd|jƒ}Wn tk r·| jdƒ}nXgd„}i}|jdkrCt|ƒ|d<||dƒ\|d<|d<||dƒ\|d<|d<||dƒ\|d<|dR=RktsearchRR™(R“RHRytautosummary_ret automodule_ret module_retautosummary_item_rettoctree_arg_rettemplate_arg_reR’ttoctreeR†tcurrent_moduletin_autosummaryt base_indenttlinetmRC((sI/usr/local/lib/python2.7/site-packages/sphinx/ext/autosummary/generate.pyRúsx          t__main__(*t__doc__ReRžR0R”Rtjinja2RRtjinja2.sandboxRtsphinxRtsphinx.ext.autosummaryRRtsphinx.jinja2glueRtsphinx.util.osutilRtsphinx.util.inspectRtsphinx.ext.autodocR R R R R RRRRR(R-R/R2R#R'RiR™Rt__name__(((sI/usr/local/lib/python2.7/site-packages/sphinx/ext/autosummary/generate.pyts@     @          ‰ V