
\c           @   s  d  Z  d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l	 m
 Z
 m Z m Z m Z m Z d d l Z d d l m Z m Z d d l m Z d d l m Z m Z m Z d d	 l m Z d d
 l m Z m Z d d l m Z m Z d d l  m! Z! m" Z" d d l# m$ Z$ d d l# m% Z% m& Z& d d l' m( Z( d d l) m* Z* m+ Z+ m, Z, m- Z- m. Z. m/ Z/ m0 Z0 m1 Z1 m2 Z2 m3 Z3 m4 Z4 m5 Z5 m6 Z6 e7 rkd d l8 m9 Z9 d d l m Z m: Z: m; Z; m< Z< m= Z= m> Z> m? Z? m@ Z@ mA ZA mB ZB d d lC mD ZD d d lE mF ZF d d lG mH ZH d d lI mJ ZJ d d lK mL ZL d d lM mN ZN n  e$ jO eP  ZQ eR eR jS  ZT e jU d e jV  ZW d   ZX eY   ZZ eY   Z[ d   Z\ d   Z] eY   Z^ d   Z_ d   Z` d   Za d  eY f d!     YZb d" ec d#  Zd ec e7 e7 d$  Ze d% ef f d&     YZg d' eY f d(     YZh d) eh f d*     YZi d+ eh f d,     YZj d- eh f d.     YZk d/ eY f d0     YZl d1 el f d2     YZm d3 el ej f d4     YZn d5 el ej f d6     YZo d7 eo f d8     YZp d9 ej f d:     YZq d; el ek f d<     YZr d= em ek f d>     YZs d? es f d@     YZt dA ef f dB     YZu dC eY f dD     YZv ev Zw dE   Zx dF   Zy dG   Zz dH   Z{ dI   Z| d S(J   sp  
    sphinx.ext.autodoc
    ~~~~~~~~~~~~~~~~~~

    Automatically insert docstrings for functions, classes or whole modules into
    the doctree, thus avoiding duplication between docstrings and documentation
    for those who like elaborate docstrings.

    :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
iN(   t   Any(   t   ViewList(   t	   iteritemst
   itervaluest	   text_typet   class_typest   string_types(   t   RemovedInSphinx20Warningt   RemovedInSphinx30Warning(   t   ExtensionError(   t   mockt   import_objectt   get_object_members(   t   _MockImporter(   t   format_annotationt   formatargspec(   t   _t   __(   t   ModuleAnalyzert   PycodeError(   t   logging(   t
   rpartitiont   force_decode(   t   prepare_docstring(   t	   Signaturet   isdescriptort   safe_getmemberst   safe_getattrt   object_descriptiont   is_builtin_class_methodt   isenumattributet   isclassmethodt   isstaticmethodt
   isfunctiont	   isbuiltint	   ispartialt   getdoc(   t
   ModuleType(
   R    t   Callablet   Dictt   Iteratort   Listt   Sequencet   Sett   Tuplet   Typet   Union(   t   nodes(   t   Reporter(   t   Sphinx(   t   Config(   t   BuildEnvironment(   t   DocumenterBridgesQ  ^ ([\w.]+::)?            # explicit module name
          ([\w.]+\.)?            # module and/or class name(s)
          (\w+)  \s*             # thing name
          (?: \((.*)\)           # optional: arguments
           (?:\s* -> \s* (.*))?  #           return annotation
          )? $                   # and nothing more
          c         C   s   |  S(   N(    (   t   x(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   identityD   s    c         C   s6   |  d k r t Sg  |  j d  D] } | j   ^ q  S(   s8   Used to convert the :members: option to auto directives.t   ,N(   t   Nonet   ALLt   splitt   strip(   t   argR5   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   members_optionM   s    c         C   s-   |  d k r t St d   |  j d  D  S(   s8   Used to convert the :members: option to auto directives.c         s   s   |  ] } | j    Vq d  S(   N(   R;   (   t   .0R5   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pys	   <genexpr>Z   s    R7   N(   R8   R9   t   setR:   (   R<   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   members_set_optionU   s    c         C   s   |  d  k r t S|  Sd  S(   N(   R8   t   SUPPRESS(   R<   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   annotation_option`   s    c         C   s   t  S(   sn   Used to convert flag options to auto directives.  (Instead of
    directives.flag(), which returns None).
    (   t   True(   R<   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   bool_optioni   s    c         C   s   d |  k r |  d t  k	 r |  j d  t  k r4 q |  j d  r xG |  d D]* } | |  d k rN |  d j |  qN qN Wq |  d |  d <n  d S(   s3   Merge :special-members: option to :members: option.s   special-memberst   membersN(   R9   t   gett   append(   t   optionst   member(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   merge_special_members_optionq   s    t   AutodocReporterc           B   sV   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(	   s   
    A reporter replacement that assigns the correct source name
    and line number to a system message, as recorded in a ViewList.
    c         C   s,   t  j d t d d | |  _ | |  _ d  S(   NsZ   AutodocReporter is now deprecated. Use sphinx.util.docutils.switch_source_input() instead.t
   stackleveli   (   t   warningst   warnR   t   viewlistt   reporter(   t   selfRO   RP   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   __init__   s    		c         C   s   t  |  j |  S(   N(   t   getattrRP   (   RQ   t   name(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   __getattr__   s    c         O   sz   d | k ra d | k ra y |  j  j | d \ } } Wn t k
 rI qa X| | d <| | d <n  |  j j | | | |  S(   Nt   linet   source(   RO   t   itemst
   IndexErrorRP   t   system_message(   RQ   t   levelt   messaget   childrent   kwargsRW   RV   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRZ      s    
c         O   s#   |  j  j r |  j d | |  Sd  S(   Ni    (   RP   t
   debug_flagRZ   (   RQ   t   argsR^   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   debug   s    c         O   s   |  j  d | |  S(   Ni   (   RZ   (   RQ   R`   R^   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   info   s    c         O   s   |  j  d | |  S(   Ni   (   RZ   (   RQ   R`   R^   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   warning   s    c         O   s   |  j  d | |  S(   Ni   (   RZ   (   RQ   R`   R^   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   error   s    c         O   s   |  j  d | |  S(   Ni   (   RZ   (   RQ   R`   R^   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   severe   s    (   t   __name__t
   __module__t   __doc__RR   RU   RZ   Ra   Rb   Rc   Rd   Re   (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRK      s   							i    c            s       f d   } | S(   s  Return a listener that removes the first *pre* and last *post*
    lines of every docstring.  If *what* is a sequence of strings,
    only docstrings of a type in *what* will be processed.

    Use like this (e.g. in the ``setup()`` function of :file:`conf.py`)::

       from sphinx.ext.autodoc import cut_lines
       app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))

    This can (and should) be used in place of :confval:`automodule_skip_lines`.
    c            ss    r |  k r d  S|  4  rO | rD | d rD | j  d  n  |   3n  | ro | d ro | j d  n  d  S(   Nit    (   t   popRG   (   t   appt   what_RT   t   objRH   t   lines(   t   postt   pret   what(    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   process   s    (    (   Rp   Ro   Rq   Rr   (    (   Ro   Rp   Rq   s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt	   cut_lines   s    c            s+   t  j |         f d   } | S(   sn  Return a listener that either keeps, or if *exclude* is True excludes,
    lines between lines that match the *marker* regular expression.  If no line
    matches, the resulting docstring would be empty, so no change will be made
    unless *keepempty* is true.

    If *what* is a sequence of strings, only docstrings of a type in *what* will
    be processed.
    c            s    r |  k r d  Sd }   } | } x{ t  |  D]m \ }	 }
 | rg | j |	 |  | d 7} n   j |
  r7 | } | r | j |	 |  | d 7} q q7 q7 W| r  r | | (n  | r | d r | j d  n  d  S(   Ni    i   iRi   (   t	   enumerateRj   t   matchRG   (   Rk   Rl   RT   Rm   RH   Rn   t   deletedt   deletet
   orig_linest   iRV   (   t   excludet	   keepemptyt	   marker_reRq   (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRr      s$    
(   t   ret   compile(   t   markerRq   R{   Rz   Rr   (    (   Rz   R{   R|   Rq   s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   between   s    
t   Optionsc           B   s   e  Z d  Z d   Z RS(   s>   A dict/attribute hybrid that returns None on nonexisting keys.c         C   s1   y |  | j  d d  SWn t k
 r, d  SXd  S(   NR   t   -(   t   replacet   KeyErrorR8   (   RQ   RT   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRU      s    (   Rf   Rg   Rh   RU   (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR      s   t
   Documenterc           B   s&  e  Z d  Z d Z d Z d Z d Z e Z i e	 d 6Z
 d   Z e d    Z d d  Z e d	    Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d d d  Z d   Z d   Z e d  Z d   Z  d   Z! e d  Z" d d e e d  Z# RS(   se  
    A Documenter knows how to autodocument a single object type.  When
    registered with the AutoDirective, it will be used to document objects
    of that type when needed by autodoc.

    Its *objtype* attribute selects what auto directive it is assigned to
    (the directive name is 'auto' + objtype), and what directive it generates
    by default, though that can be overridden by an attribute called
    *directivetype*.

    A Documenter has an *option_spec* that works like a docutils directive's;
    in fact, it will be used to parse an auto directive's options that matches
    the documenter.
    t   objectu      i    t   noindexc         G   s   t  |  j j | | |  S(   s5   getattr() override for types such as Zope interfaces.(   t   autodoc_attrgettert   envRk   (   RQ   Rm   RT   t   defargs(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   get_attr  s    c         C   s   t  d   d S(   s?   Called to see if a member can be documented by this documenter.s!   must be implemented in subclassesN(   t   NotImplementedError(   t   clsRI   t
   membernamet   isattrt   parent(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   can_document_member$  s    u    c         C   s   | |  _  | j |  _ | j |  _ | |  _ | |  _ d  |  _ d  |  _ d  |  _	 d  |  _
 d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  S(   N(   t	   directiveR   t   genoptRH   RT   t   indentR8   t   modnamet   modulet   objpatht   fullnameR`   t   retannR   t   object_nameR   t   analyzer(   RQ   R   RT   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRR   *  s    												c         C   s   t  |  j j  S(   s%   Returns registered Documenter classes(   t   get_documentersR   Rk   (   RQ   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   documentersC  s    c         G   s$   |  j  j j |  j | | |  d S(   s0   Append one line of generated reST to the output.N(   R   t   resultRG   R   (   RQ   RV   RW   t   lineno(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   add_lineI  s    c         C   s   t  d   d S(   s@  Resolve the module and name of the object to document given by the
        arguments and the current module/class.

        Must return a pair of the module name and a chain of attributes; for
        example, it would return ``('zipfile', ['ZipFile', 'open'])`` for the
        ``zipfile.ZipFile.open`` method.
        s!   must be implemented in subclassesN(   R   (   RQ   R   t   parentst   patht   base(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   resolve_nameN  s    	c         C   s(  y+ t  j |  j  j   \ } } } } } Wn5 t k
 rb t j t d  |  j |  j f  t	 SX| d k	 r | d  } | r | j d  j d  p g  } n d } g  } |  j | | | |  \ |  _ |  _ |  j s t	 S| |  _ | |  _ |  j p d |  j rd d j |  j  pd |  _ t S(   s   Determine what module to import and what attribute to document.

        Returns True and sets *self.modname*, *self.objpath*, *self.fullname*,
        *self.args* and *self.retann* if parsing and resolving was successful.
        s!   invalid signature for auto%s (%r)it   .Ri   N(   t   py_ext_sig_reRu   RT   t   groupst   AttributeErrort   loggerRc   R   t   objtypet   FalseR8   t   rstripR:   R   R   R   R`   R   t   joinR   RC   (   RQ   t   explicit_modnameR   R   R`   R   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt
   parse_nameY  s$    
+#
'$			)c         C   s   t  |  j j j   yY t |  j |  j |  j d |  j d |  j j j	 } | \ |  _
 |  _ |  _ |  _ t SWn5 t k
 r } t j | j d  |  j j   t SXWd QXd S(   s   Import the object given by *self.modname* and *self.objpath* and set
        it as *self.object*.

        Returns True if successful, False if an error occurred.
        t
   attrgettert   warningiserrori    N(   R
   R   t   configt   autodoc_mock_importsR   R   R   R   R   t   autodoc_warningiserrorR   R   R   R   RC   t   ImportErrorR   Rc   R`   t   note_rereadR   (   RQ   t   rett   exc(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   }  s    	c         C   s   |  j  |  j d d  p |  j S(   s   Get the real module name of an object to document.

        It can differ from the name of the module through which the object was
        imported.
        Rg   N(   R   R   R8   R   (   RQ   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   get_real_modname  s    c         C   sd   |  j  j r t S|  j |  j d d  } t |  j  rG | d k rG t S| r` | |  j k r` t St S(   s`   Check if *self.object* is really defined in the module given by
        *self.modname*.
        Rg   t
   _functoolsN(	   RH   t   imported_membersRC   R   R   R8   R#   R   R   (   RQ   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   check_module  s    c         C   s   d S(   s}   Format the argument signature of *self.object*.

        Should return None if the object does not have a signature.
        N(   R8   (   RQ   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   format_args  s    c         C   s   d j  |  j  p |  j S(   s   Format the name of *self.object*.

        This normally should be something that can be parsed by the generated
        directive, but doesn't need to be (Sphinx will display it unparsed
        then).
        R   (   R   R   R   (   RQ   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   format_name  s    
c         C   s   |  j  d k	 r d |  j  } nL y |  j   } Wn9 t k
 rj } t j t d  |  j | f  d } n X|  j } |  j	 j
 j d |  j |  j |  j |  j | |  } | r | \ } } n  | d k	 r | | r d | p d Sd Sd S(   s   Format the signature (arguments and return annotation) of the object.

        Let the user process it via the ``autodoc-process-signature`` event.
        s   (%s)s+   error while formatting arguments for %s: %ss   autodoc-process-signatures    -> %sRi   N(   R`   R8   R   t	   ExceptionR   Rc   R   R   R   R   Rk   t   emit_firstresultR   R   RH   (   RQ   R`   t   errR   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   format_signature  s"    
	c         C   s   t  |  d d  } t  |  d |  j  } |  j   } |  j   } |  j d | | | | f |  |  j j r~ |  j d |  n  |  j r |  j d |  j |  n  d S(   s>   Add the directive header and options to the generated content.t   domaint   pyt   directivetypeu   .. %s:%s:: %s%su      :noindex:u      :module: %sN(	   RS   R   R   t   get_sourcenameR   RH   R   R   R   (   RQ   t   sigR   R   RT   t
   sourcename(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   add_directive_header  s    	i   c         C   sl   t  |  j |  j |  j j j  } t | t  r@ t | |  g St | t	  rh t t
 | |  |  g Sg  S(   s;   Decode and return lines of the docstring(s) for the object.(   R$   R   R   R   R   t   autodoc_inherit_docstringst
   isinstanceR   R   t   strR   (   RQ   t   encodingt   ignoret	   docstring(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   get_doc  s    
c         c   sh   xa | D]Y } |  j  j rJ |  j  j j d |  j |  j |  j |  j |  n  x | D] } | VqQ Wq Wd S(   s7   Let the user process the docstrings before adding them.s   autodoc-process-docstringN(   R   Rk   t   emitR   R   R   RH   (   RQ   t
   docstringst   docstringlinesRV   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   process_doc  s    c         C   sg   |  j  r\ t |  j  j t  s? t |  j  j t j   d  } n |  j  j } d | |  j f Sd |  j S(   NR   u   %s:docstring of %su   docstring of %s(   R   R   t   srcnameR   t   syst   getfilesystemencodingR   (   RQ   t   filename(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    	c         C   s{  |  j    } |  j r |  j j   } |  j r d j |  j d   |  j d f } | | k r t } | | g } x9 t |  j |   D] \ } } |  j | | |  q Wq q n  | s-|  j o |  j j	 }	 |  j
 |	  } | s | j g   n  x9 t |  j |   D] \ } } |  j | | |  qWn  | rwxA t | j | j  D]' \ } }
 |  j | |
 d |
 d  qIWn  d S(   s>   Add content from docstrings, attribute documentation and user.R   ii    i   N(   R   R   t   find_attr_docsR   R   RC   Rt   R   R   R   R   RG   t   zipt   dataRX   (   RQ   t   more_contentt   no_docstringR   t	   attr_docst   keyR   Ry   RV   R   t   src(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   add_content  s(    		#" ""c         C   s  t  |  j |  j |  j |  j  } | s |  j j s= t g  f Sg  } x] |  j j D]O } | | k r | j | | | j	 f  qP t
 j t d  | |  j f  qP Wt t |  f S|  j j r t t d   t |  D  f St t d   t |  D  f Sd S(   s+  Return `(members_check_module, members)` where `members` is a
        list of `(membername, member)` pairs of the members of *self.object*.

        If *want_all* is True, return all members.  Else, only return those
        members given by *self.options.members* (which may also be none).
        s!   missing attribute %s in object %sc         s   s!   |  ] } | j  | j f Vq d  S(   N(   RT   t   value(   R>   t   m(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pys	   <genexpr>H  s    c         s   s*   |  ]  } | j  r | j | j f Vq d  S(   N(   t   directly_definedRT   R   (   R>   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pys	   <genexpr>J  s    N(   R   R   R   R   R   RH   RE   R   RG   R   R   Rc   R   R   t   sortedt   inherited_membersR   (   RQ   t   want_allRE   t   selectedRT   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   2  s    !
 c         C   s  g  } d j  |  j  } |  j r3 |  j j   } n i  } xx| D]p\ } } t } t | |  j |  j j j	  }	 |  j | d d	  }
 |
 r |  j |
 d d	  } | |	 k r d	 }	 q n  t |	  } t } | r{| j d  r{| j d  r{t |  d k r{|  j j t k r3| d k r3| p-|  j j } q|  j j r|  j j t k	 r| |  j j k r| pr|  j j } qn | | f | k r| r| j d  r|  j j } n t } t } nH | r| j d  r|  j j o| p|  j j } n | p|  j j } |  j j ryE |  j j j d |  j | | | |  j  } | d	 k	 rX| } n  Wqt k
 r} t j t d  | |  t } qXn  | r@ | j | | | f  q@ q@ W| S(
   s  Filter the given member list.

        Members are skipped if

        - they are private (except if given explicitly or the private-members
          option is set)
        - they are special methods (except if given explicitly or the
          special-members option is set)
        - they are undocumented (except if the undoc-members option is set)

        The user can override the skipping decision by connecting to the
        ``autodoc-skip-member`` event.
        R   t	   __class__Rh   R   i   R   s   autodoc-skip-membersW   autodoc: failed to determine %r to be documented.the following exception was raised:
%sN(   R   R   R   R   R   R$   R   R   R   R   R8   t   boolt
   startswitht   endswitht   lenRH   t   special_membersR9   t   undoc_memberst   private_membersRC   Rk   R   R   R   R   Rc   R   RG   (   RQ   RE   R   R   t	   namespaceR   R   RI   R   t   docR   t   cls_doct   has_doct   keept	   skip_userR   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   filter_membersM  s^    	!	
c            s  |  j  |  j j d <|  j r6 |  j d |  j j d <n  | pW |  j j pW |  j j t k } |  j |  \ } } |  j j	 r g  | D]< \ } } |  j j	 t k s | |  j j	 k r | | f ^ q } n  g  } x |  j
 | |  D] \ } } }	 g  t |  j  D]$ }
 |
 j | | |	 |   r |
 ^ q } | s5q n  | j d d    |  j  d d j |  j | g  } | d |  j | |  j  } | j | |	 f  q W|  j j p|  j j j } | d	 k r| j d d
    nC | d k r|  j r|  j j     f d   } | j d |  n  x: | D]2 \ } }	 | j d t d |  j d | oT|	  q&Wd |  j j d <d |  j j d <d S(   s   Generate reST for member documentation.

        If *all_members* is True, do all members, else those given by
        *self.options.members*.
        s   autodoc:modulei    s   autodoc:classR   c         S   s   |  j  S(   N(   t   priority(   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   <lambda>  s    s   ::R   it	   groupwisec         S   s   |  d j  S(   Ni    (   t   member_order(   t   e(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    t   bysourcec            s0   |  d j  j d  d }   j | t     S(   Ni    s   ::i   (   RT   R:   RF   R   (   t   entryR   (   t   tagorder(    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   keyfunc  s    t   all_memberst   real_modnameR   N(   R   R   t	   temp_dataR   RH   R   RE   R9   R   t   exclude_membersR   R   R   R   t   sortR   R   R   RG   R   R   t   autodoc_member_orderR   R   t   generateRC   R  R8   (   RQ   R  R   t   members_check_moduleRE   R   RI   t   memberdocumenterst   mnameR   R   t   classest
   full_mnamet
   documenterR   R   (    (   R   s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   document_members  sF    	'"$
	c         C   s  |  j    s* t j t d  |  j  d S|  j   s: d S| pI |  j   |  _ y& t j	 |  j  |  _
 |  j
 j   Wnf t k
 r } t j d |  d |  _
 t |  j d  r |  j j r |  j j j |  j j  q n X|  j j j |  j
 j  | r|  j   sd Sn  |  j   } |  j d |  |  j   } |  j |  |  j d |  |  j |  j 7_ |  j |  |  j |  d S(   s  Generate reST for the object given by *self.name*, and possibly for
        its members.

        If *more_content* is given, include that content. If *real_modname* is
        given, use that module name to find attribute docs. If *check_module* is
        True, only generate if the object is defined in the module name it is
        imported from. If *all_members* is True, document all members.
        s   don't know which module to import for autodocumenting %r (try placing a "module" or "currentmodule" directive in the document, or giving an explicit module name)Ns$   [autodoc] module analyzer failed: %st   __file__u    (   R   R   Rc   R   RT   R   R   R  R   t
   for_moduleR   R   R   Ra   R8   t   hasattrR   R  R   t   filename_sett   addR   R   R   R   R   R   R   t   content_indentR   R  (   RQ   R   R  R   R  R   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR    s8    		 N($   Rf   Rg   Rh   R   R  R   R   R   t   titles_allowedRD   t   option_specR   t   classmethodR   RR   t   propertyR   R   R   R   R   R   R   R   R   R   R   R8   R   R   R   R   R   R   R  R  (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s<   				$										 		YDt   ModuleDocumenterc           B   s   e  Z d  Z d Z d Z e Z i e d 6e d 6e d 6e d 6e d 6e	 d 6e	 d	 6e d
 6e	 d 6e
 d 6e d 6e d 6e d 6e d 6Z d   Z e d    Z d   Z d   Z d   Z d   Z RS(   s6   
    Specialized Documenter subclass for modules.
    R   u    RE   s   undoc-membersR   s   inherited-memberss   show-inheritancet   synopsist   platformt
   deprecateds   member-orders   exclude-memberss   private-memberss   special-memberss   imported-memberss   ignore-module-allc         G   s'   t  t |   j |   t |  j  d  S(   N(   t   superR  RR   RJ   RH   (   RQ   R`   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRR   H  s    c         C   s   t  S(   N(   R   (   R   RI   R   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   M  s    c         C   s6   | d  k	 r" t j t d   n  | p+ d | g  f S(   Ns*   "::" in automodule name doesn't make senseRi   (   R8   R   Rc   R   (   RQ   R   R   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   S  s    c         C   sB   t  j |   } |  j s! |  j r> t j t d  |  j  n  | S(   Ns@   signature arguments or return annotation given for automodule %s(   R   R   R`   R   R   Rc   R   R   (   RQ   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   Y  s
    c         C   s   t  j |  |  |  j   } |  j j rE |  j d |  j j |  n  |  j j rn |  j d |  j j |  n  |  j j r |  j d |  n  d  S(   Nu      :synopsis: u      :platform: u      :deprecated:(   R   R   R   RH   R  R   R  R  (   RQ   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   a  s    c         C   s=  | r |  j  j s% t |  j d  r8 t t |  j  f S|  j j } t | t t	 f  sq t
 d   | D  r t j t d  | |  j f  t t |  j  f Sn |  j  j p g  } g  } xq | D]i } y# | j | t |  j |  f  Wq t k
 r.t j t d  t |  j d d  | f  q Xq Wt | f S(   Nt   __all__c         s   s   |  ] } t  | t  Vq d  S(   N(   R   R   (   R>   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pys	   <genexpr>}  s    sN   __all__ should be a list of strings, not %r (in module %s) -- ignoring __all__sL   missing attribute mentioned in :members: or __all__: module %s, attribute %sRf   s   ???(   RH   t   ignore_module_allR  R   RC   R   R  R   t   listt   tuplet   allR   Rc   R   R   RE   RG   R   R   R   (   RQ   R   t
   memberlistR   R
  (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   q  s*    	#	%(   Rf   Rg   Rh   R   R  RC   R  R=   RD   R6   R@   R  RR   R  R   R   R   R   R   (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR  6  s$   				t   ModuleLevelDocumenterc           B   s   e  Z d  Z d   Z RS(   so   
    Specialized Documenter subclass for objects on module level (functions,
    classes, data/constants).
    c         C   sk   | d  k rZ | r$ | j d  } qZ |  j j j d  } | sZ |  j j j d  } qZ n  | | | g f S(   NR   s   autodoc:modules	   py:module(   R8   R   R   R  RF   t   ref_context(   RQ   R   R   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    (   Rf   Rg   Rh   R   (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR$    s   t   ClassLevelDocumenterc           B   s   e  Z d  Z d   Z RS(   s_   
    Specialized Documenter subclass for objects on class level (methods,
    attributes).
    c         C   s   | d  k r | r$ | j d  } nU d  } |  j j j d  } | d  k rc |  j j j d  } n  | d  k ry d  g  f St | d  \ } } | g } | s |  j j j d  } n  | s |  j j j d  } q n  | | | g f S(   NR   s   autodoc:classs   py:classs   autodoc:modules	   py:module(   R8   R   R   R  RF   R%  R   (   RQ   R   R   R   R   t   mod_clsR   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s     
	(   Rf   Rg   Rh   R   (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR&    s   t   DocstringSignatureMixinc           B   s2   e  Z d  Z d d  Z d d d  Z d   Z RS(   s   
    Mixin for FunctionDocumenter and MethodDocumenter to provide the
    feature of reading the signature from the docstring.
    c         C   s&  |  j  |  } | |  _ d  } x t |  D] \ } } | sD q, n  t j | d  } | sc q, n  | j   \ } } }	 }
 } |  j d g } t |  t	  r | j
 d  t |  j d  r | j d   |  j j D  q n  |	 | k r q, n  t d j | d   |  j | <|
 | f } Pq, W| S(   Ni    iRR   t   __mro__c         s   s   |  ] } | j  Vq d  S(   N(   Rf   (   R>   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pys	   <genexpr>  s    s   
i   (   R   t   _new_docstringsR8   Rt   R   Ru   R   R   R   t   ClassDocumenterRG   R  R   t   extendR)  R   R   (   RQ   R   R   R   Ry   t   doclinesRu   t   exmodR   R   R`   R   t   valid_names(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   _find_signature  s*    
# i   c         C   s5   t  |  d d   } | d  k	 r" | St j |  | |  S(   NR*  (   RS   R8   R   R   (   RQ   R   R   Rn   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    c         C   s[   |  j  d  k rN |  j j j rN |  j   } | d  k	 rN | \ |  _  |  _ qN n  t j |   S(   N(	   R`   R8   R   R   t   autodoc_docstring_signatureR0  R   R   R   (   RQ   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s
    N(   Rf   Rg   Rh   R8   R0  R   R   (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR(    s   t   DocstringStripSignatureMixinc           B   s   e  Z d  Z d   Z RS(   sz   
    Mixin for AttributeDocumenter to provide the
    feature of stripping any function signature from the docstring.
    c         C   sX   |  j  d  k rK |  j j j rK |  j   } | d  k	 rK | \ } |  _ qK n  t j |   S(   N(	   R`   R8   R   R   R1  R0  R   R   R   (   RQ   R   t   _args(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s
    (   Rf   Rg   Rh   R   (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR2    s   t   FunctionDocumenterc           B   s>   e  Z d  Z d Z d Z e d    Z d   Z e d  Z	 RS(   s8   
    Specialized Documenter subclass for functions.
    t   functioni   c         C   s   t  |  p t |  S(   N(   R!   R"   (   R   RI   R   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    c         C   s  t  |  j  s! t j |  j  r% d  Sy t |  j  r t j |  j  r t  |  j  r t j |  j  r t |  j d  r t	 |  j j
  j   } n t	 |  j  j   } Wn t k
 rjt |  j d  r t |  j d  r t d |  j   n  y. t	 |  j j d t d t } | j   } Wqkt k
 rft	 |  j j d t d t } | j   } qkXn X| j d d  } | S(	   Nt   __call__t   __new__RR   s   %r is a builtin classt   bound_methodt
   has_retvals   \s   \\(   R"   R   t   inspectt   ismethoddescriptorR8   R!   t   ismethodt   isclassR  R   R6  R   t	   TypeErrorR   R7  RC   R   RR   R   (   RQ   R`   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s,    !c         C   s   d  S(   N(    (   RQ   R  (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR  =  s    (
   Rf   Rg   Rh   R   R   R  R   R   R   R  (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR4    s   	!R+  c           B   s   e  Z d  Z d Z d Z i	 e d 6e d 6e d 6e d 6e d 6e d 6e d	 6e d
 6e d 6Z	 d   Z
 e d    Z d   Z d   Z d   Z d   Z d d d  Z e d  Z e d  Z d d e e d  Z RS(   s6   
    Specialized Documenter subclass for classes.
    t   classi   RE   s   undoc-membersR   s   inherited-memberss   show-inheritances   member-orders   exclude-memberss   private-memberss   special-membersc         G   s'   t  t |   j |   t |  j  d  S(   N(   R  R+  RR   RJ   RH   (   RQ   R`   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRR   P  s    c         C   s   t  | t  S(   N(   R   R   (   R   RI   R   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   U  s    c         C   sV   t  j |   } | rR t |  j d  rF |  j d |  j j k |  _ qR t |  _ n  | S(   NRf   i(   R$  R   R  R   R   Rf   t   doc_as_attrRC   (   RQ   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   Z  s    c         C   s   |  j  |  j d d   } | d  k sR t |  j d  sR t j |  pN t |  rV d  Sy  t | d t d t	 j
   SWn t k
 r d  SXd  S(   NRR   R8  R9  (   R   R   R8   R   R:  R<  R!   R   RC   R   R   R>  (   RQ   t   initmeth(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   f  s     c         C   s   |  j  r d St j |   S(   NRi   (   R@  R(  R   (   RQ   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   w  s    	c         C   s   |  j  r d |  _ n  t j |  |  |  j  r |  j j r |  j   } |  j d |  t |  j	 d  r t
 |  j	 j  r g  |  j	 j D]8 } | j d k r d | j p d | j | j f ^ q } |  j d t d	  d
 j |  |  q n  d  S(   Nt	   attributeu    t	   __bases__t   __builtin__t   builtinsu   :class:`%s`u   :class:`%s.%s`u      u	   Bases: %ss   , (   RD  RE  (   R@  R   R   R   RH   t   show_inheritanceR   R   R  R   R   RC  Rg   Rf   R   R   (   RQ   R   R   t   bt   bases(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   ~  s    	$H i   c   
      C   s  t  |  d d   } | d  k	 r" | S|  j j j } g  } |  j |  j d d   } | re | j |  n  | d k rq|  j |  j |  j d d   d  } | d  k	 r | t j j	 k s | j
   t j j	 k r d  } n  | s@|  j |  j |  j d d   d  } | d  k	 r@| t j j	 k s4| j
   t j j	 k r@d  } q@n  | rq| d k r^| g } qn| j |  qqn  g  } xg | D]_ }	 t |	 t  r| j t |	 |   q~t |	 t  r~| j t t |	 |  |   q~q~W| S(   NR*  Rh   t   botht   initRR   R7  (   RI  RJ  (   RS   R8   R   R   t   autoclass_contentR   R   RG   RR   Rh   R;   R7  R   R   R   R   R   (
   RQ   R   R   Rn   t   contentR   t   attrdocstringt   initdocstringR   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     sD    	c         C   s   |  j  r t |  j d d   } | s< t |  j d d   } n  | r t |  j d d   } t |  j d d   } | r | | k r t |  d t |  } n  t t d  | g d d } t j	 |  | d t
 q n t j	 |  |  d  S(	   Nt   __qualname__Rf   Rg   u   .s   alias of :class:`%s`RW   Ri   R   (   R@  R   R   R8   R   R   R   R   R$  R   RC   (   RQ   R   R   t	   classnameR   t   parentmoduleRL  (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    	c         C   s!   |  j  r d  St j |  |  d  S(   N(   R@  R$  R  (   RQ   R  (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR    s    	c         C   s%   t  t |   j d | d | d |  S(   NR   R   R  (   R  R+  R  (   RQ   R   R  R   R  (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR    s    N(   Rf   Rg   Rh   R   R   R=   RD   R6   R@   R  RR   R  R   R   R   R   R   R8   R   R   R   R  R  (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR+  B  s(   					.t   ExceptionDocumenterc           B   s/   e  Z d  Z d Z d Z d Z e d    Z RS(   s>   
    Specialized ClassDocumenter subclass for exceptions.
    t	   exceptioni
   c         C   s   t  | t  o t | t  S(   N(   R   R   t
   issubclasst   BaseException(   R   RI   R   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    (   Rf   Rg   Rh   R   R   R   R  R   (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRR    s
   t   DataDocumenterc           B   sf   e  Z d  Z d Z d Z d Z e e j  Z e	 e d <e
 d    Z d   Z e d  Z d   Z RS(	   s9   
    Specialized Documenter subclass for data items.
    R   i(   it
   annotationc         C   s   t  | t  o | S(   N(   R   R  (   R   RI   R   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    c         C   s   t  j |  |  |  j   } |  j j sf y t |  j  } Wn t k
 rN q X|  j d | |  n/ |  j j t	 k r{ n |  j d |  j j |  d  S(   Nu      :annotation: = u      :annotation: %s(
   R$  R   R   RH   RW  R   R   t
   ValueErrorR   RA   (   RQ   R   R   t   objrepr(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    c         C   s   d  S(   N(    (   RQ   R  (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR    s    c         C   s(   |  j  |  j p |  j d d   p' |  j S(   NRg   (   R   R   R   R8   R   (   RQ   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    !(   Rf   Rg   Rh   R   R   R   t   dictR$  R  RB   R  R   R   R   R  R   (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRV    s   
	t   MethodDocumenterc           B   sM   e  Z d  Z d Z d Z d Z e d    Z d   Z d   Z	 e
 d  Z RS(   sQ   
    Specialized Documenter subclass for methods (normal, static and class).
    t   methodi2   i   c         C   s   t  j |  o t | t  S(   N(   R:  t	   isroutineR   R  (   R   RI   R   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   &  s    c         C   s   t  j |   } | s | S|  j j j |  j  } | d  k rI |  j } n  t |  rq d |  _	 |  j
 d |  _
 nC t | d |  j d |  j r d |  _	 |  j
 d |  _
 n	 d |  _	 | S(   NR  i   R   RT   t   staticmethodR\  (   R&  R   R   t   __dict__RF   R   R8   R   R   R   R   R    (   RQ   R   Rm   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   ,  s    			c         C   s   t  |  j  s! t j |  j  r% d  St |  j d |  j d |  j rd t |  j d t	 j
   } n t |  j d t j
   } | j d d  } | S(   NR   RT   R8  s   \s   \\(   R"   R   R:  R;  R8   R    R   R   R   R   R   RC   R   (   RQ   R`   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   C  s    !!c         C   s   d  S(   N(    (   RQ   R  (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR  P  s    (   Rf   Rg   Rh   R   R   R   R  R   R   R   R   R  (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR[    s   		t   AttributeDocumenterc           B   s   e  Z d  Z d Z d Z e e j  Z e e d <d Z	 e
 d    Z e d    Z e d  Z d   Z d	   Z d
   Z e d  Z RS(   s9   
    Specialized Documenter subclass for attributes.
    RB  i<   RW  i
   c         C   s%   t  |   p$ t |   p$ t j |   S(   N(   R!   R"   R:  R<  (   Rm   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   is_function_or_methodb  s    c         C   s   t  t f } t |  oK |  j |  oK t | |  oK t  |  j d k } | p t | t  o t j |  o t | t	  S(   Nt   instancemethod(
   t   typet   MethodDescriptorTypeR   Ra  R   Rf   R  R:  R]  R   (   R   RI   R   R   R   t   non_attr_typest
   isdatadesc(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   g  s    c         C   s   d  S(   N(    (   RQ   R  (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR  v  s    c         C   sk   t  j |   } t |  j  r0 |  j j |  _ n  t |  j  r^ |  j |  j  r^ t |  _ n	 t	 |  _ | S(   N(
   R&  R   R   R   R   R   Ra  RC   t   _datadescriptorR   (   RQ   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR   z  s    	c         C   s(   |  j  |  j p |  j d d   p' |  j S(   NRg   (   R   R   R   R8   R   (   RQ   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    !c         C   s   t  j |  |  |  j   } |  j j sr |  j s y t |  j  } Wn t k
 rW qo X|  j	 d | |  q n/ |  j j t
 k r n |  j	 d |  j j |  d  S(   Nu      :annotation: = u      :annotation: %s(   R&  R   R   RH   RW  Rg  R   R   RX  R   RA   (   RQ   R   R   RY  (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    	c         C   s)   |  j  s t } n  t j |  | |  d  S(   N(   Rg  RC   R&  R   (   RQ   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    		(   Rf   Rg   Rh   R   R   RZ  R$  R  RB   R   R^  Ra  R  R   R   R  R   R   R   R   (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR`  U  s   
			t   InstanceAttributeDocumenterc           B   sJ   e  Z d  Z d Z d Z d Z d Z e d    Z d   Z	 e
 d  Z RS(   s   
    Specialized Documenter subclass for attributes that cannot be imported
    because they are instance attributes (e.g. assigned in __init__).
    t   instanceattributeRB  i<   i   c         C   s   | o | t  k S(   s)   This documents only INSTANCEATTR members.(   t   INSTANCEATTR(   R   RI   R   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    c         C   s   d |  _  t |  _ t S(   s   Never import anything.RB  (   R   R   Rg  RC   (   RQ   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    		c         C   s   t  j |  | d t d S(   s-   Never try to get a docstring from the object.R   N(   R`  R   RC   (   RQ   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    (   Rf   Rg   Rh   R   R   R   R   R  R   R   R   R   (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRh    s   	t   DeprecatedDictc           B   s2   e  Z d    Z d   Z d d  Z d d  Z RS(   c         C   s    | |  _  t t |   j   d  S(   N(   R\   R  Rk  RR   (   RQ   R\   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRR     s    	c         C   s6   t  j |  j t d d t t |   j | |  d  S(   NRL   i   (   RM   RN   R\   R   R  Rk  t   __setitem__(   RQ   R   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRl    s    c         C   s6   t  j |  j t d d t t |   j | |  d  S(   NRL   i   (   RM   RN   R\   R   R  Rk  t
   setdefault(   RQ   R   t   default(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRm    s    c         C   s3   t  j |  j t d d t t |   j |  d  S(   NRL   i   (   RM   RN   R\   R   R  Rk  t   update(   RQ   t   other(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRo    s    N(   Rf   Rg   RR   Rl  R8   Rm  Ro  (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRk    s   		t   AutodocRegistryc           B   s&   e  Z d  Z e d  Z e d  Z RS(   s'  
    A registry of Documenters and attrgetters.

    Note: When importing an object, all items along the import chain are
    accessed using the descendant's *_special_attrgetters*, thus this
    dictionary should include all necessary functions for accessing
    attributes of the parents.
    sY   AutoDirective._registry has been deprecated. Please use app.add_autodocumenter() instead.sh   AutoDirective._special_attrgetters has been deprecated. Please use app.add_autodoc_attrgetter() instead.(   Rf   Rg   Rh   Rk  t	   _registryt   _special_attrgetters(    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyRq    s
   	c         C   sL   t  j d t d d t |  t  s8 t d |    n  |  t j |  j <d S(   s   Register a new Documenter.se   sphinx.ext.autodoc.add_documenter() has been deprecated. Please use app.add_autodocumenter() instead.RL   i   s6   autodoc documenter %r must be a subclass of DocumenterN(	   RM   RN   R   RT  R   R	   t   AutoDirectiveRr  R   (   R   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   add_documenter  s    	c         C   s/   t  t j  } |  r+ | j |  j j  n  | S(   s%   Returns registered Documenter classes(   RZ  Rt  Rr  Ro  t   registryR   (   Rk   R  (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    c         G   sw   t  t j  } |  r+ | j |  j j  n  x9 t |  D]+ \ } } t | |  r8 | | | |  Sq8 Wt | | |  S(   s   Alternative getattr() for types(	   RZ  Rt  Rs  Ro  Rv  t   autodoc_attrgettrsR   R   R   (   Rk   Rm   RT   R   t
   candidatest   typt   func(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyR     s    c         C   sp   | j  s d St j d t d d xF | j  D]; } t | t  rR d | j | <q- t j	 t
 d  |  q- Wd S(   sA   This merges the autodoc_default_flags to autodoc_default_options.NsT   autodoc_default_flags is now deprecated. Please use autodoc_default_options instead.RL   i   s4   Ignoring invalid option in autodoc_default_flags: %r(   t   autodoc_default_flagsRM   RN   R   R   R   R8   t   autodoc_default_optionsR   Rc   R   (   Rk   R   t   option(    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   merge_autodoc_default_flags  s    			c         C   sL  |  j  t  |  j  t  |  j  t  |  j  t  |  j  t  |  j  t  |  j  t  |  j  t  |  j	 d d t
  |  j	 d d t
  |  j	 d g  t
  |  j	 d i  t
  |  j	 d t
 t
  |  j	 d g  t
  |  j	 d	 t
 t
  |  j	 d
 t
 t
  |  j d  |  j d  |  j d  |  j d t  i t j d 6t
 d 6S(   NRK  R?  R  t
   alphabeticR{  R|  R1  R   R   R   s   autodoc-process-docstrings   autodoc-process-signatures   autodoc-skip-members   config-initedt   versiont   parallel_read_safe(   t   add_autodocumenterR  R+  RR  RV  R4  R[  R`  Rh  t   add_config_valueRC   t	   add_eventt   connectR~  t   sphinxt   __display_version__(   Rk   (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   setup6  s*    (}   Rh   R:  R}   R   RM   t   typingR    t   docutils.statemachineR   t   sixR   R   R   R   R   R  t   sphinx.deprecationR   R   t   sphinx.errorsR	   t   sphinx.ext.autodoc.importerR
   R   R   R   t   sphinx.ext.autodoc.inspectorR   R   t   sphinx.localeR   R   t   sphinx.pycodeR   R   t   sphinx.utilR   R   R   t   sphinx.util.docstringsR   t   sphinx.util.inspectR   R   R   R   R   R   R   R   R    R!   R"   R#   R$   R   t   typesR%   R&   R'   R(   R)   R*   R+   R,   R-   R.   t   docutilsR/   t   docutils.utilsR0   t   sphinx.applicationR1   t   sphinx.configR2   t   sphinx.environmentR3   t   sphinx.ext.autodoc.directiveR4   t	   getLoggerRf   R   Rc  t   __subclasses__Rd  R~   t   VERBOSER   R6   R   R9   Rj  R=   R@   RA   RB   RD   RJ   RK   R8   Rs   R   RZ  R   R   R  R$  R&  R(  R2  R4  R+  RR  RV  R[  R`  Rh  Rk  Rq  Rt  Ru  R   R   R~  R  (    (    (    s:   lib/python2.7/site-packages/sphinx/ext/autodoc/__init__.pyt   <module>   s   (XF										6&
  6\!52*7R 					