ó ÿgdSc@s‹dZddlmZddlmZd„Zdefd„ƒYZdefd„ƒYZd efd „ƒYZ d efd „ƒYZ d S(s8 sphinx.util.docfields ~~~~~~~~~~~~~~~~~~~~~ "Doc fields" are reST field lists in object descriptions that will be domain-specifically transformed to a more appealing presentation. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. iÿÿÿÿ(tnodes(taddnodescCstt|ƒdkrtSt|ƒdkrVx+|dD]}t|tjƒs3tSq3Wnt|dtjƒrptStS(sCTrue if the node only contains one paragraph (and system messages).ii(tlentFalset isinstanceRtsystem_messaget paragraphtTrue(tnodetsubnode((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyt_is_single_paragraphs tFieldcBsPeZdZeZeZddedd„Ze j d„Z d„Z d„Z RS(sK A doc field that is never grouped. It can have an argument or not, the argument can be linked using a specified *rolename*. Field should be used for doc fields that usually don't occur more than once. Example:: :returns: description of the return value :rtype: description of the return type cCs1||_||_||_||_||_dS(N(tnametnamestlabelthas_argtrolename(tselfR R RRR((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyt__init__-s     c CsQ|s|||ƒStjdd|dtd|d|ƒ}||||ƒ7}|S(Ntt refdomaint refexplicittreftypet reftarget(Rt pending_xrefR(RRtdomainttargett innernodetrefnode((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyt make_xref4s  cCs ||fS(N((Rtfieldargtcontent((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyt make_entry<scCs“|\}}tjd|jƒ}|r_|tjdƒ7}||j|j||tjƒ7}ntjdtjdd|Œƒ}tjd||ƒS(NRt ( Rt field_nameRtTextRRt field_bodyRtfield(RttypesRtitemRRt fieldnamet fieldbody((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyt make_field?s !(N(t__name__t __module__t__doc__Rt is_groupedtis_typedtNoneRRRtemphasisRR R*(((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyR s  t GroupedFieldcBs;eZdZeZejZddde d„Z d„Z RS(s× A doc field that is grouped; i.e., all fields of that type will be transformed into one field with its body being a bulleted list. It always has an argument. The argument can be linked using the given *rolename*. GroupedField should be used for doc fields that can occur more than once. If *can_collapse* is true, this field will revert to a Field if only used once. Example:: :raises ErrorClass: description when it is raised cCs)tj||||t|ƒ||_dS(N(R RRt can_collapse(RR R RRR3((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyRZsc Csótjd|jƒ}|jƒ}t|ƒdkrV|jrVtj||||dƒSxu|D]m\}}tjƒ}||j |j ||tj ƒ7}|tj dƒ7}||7}|tj d|ƒ7}q]Wtjd|ƒ} tjd|| ƒS(NRiis -- (RR"Rt list_typeRR3R R*RRRtstrongR#t list_itemR$R%( RR&RtitemsR(tlistnodeRRtparR)((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyR*_s  " (N( R+R,R-RR.Rt bullet_listR4R0RRR*(((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyR2Js     t TypedFieldcBs8eZdZeZddddded„Zd„ZRS(sa A doc field that is grouped and has type information for the arguments. It always has an argument. The argument can be linked using the given *rolename*, the type using the given *typerolename*. Two uses are possible: either parameter and type description are given separately, using a field from *names* and one from *typenames*, respectively, or both are given using a field from *names*, see the example. Example:: :param foo: description of parameter foo :type foo: SomeClass -- or -- :param SomeClass foo: description of parameter foo cCs2tj||||||ƒ||_||_dS(N(R2Rt typenamest typerolename(RR R R<RRR=R3((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyRƒs c s·‡‡fd†}tjdˆjƒ}t|ƒdkrgˆjrg|d\}}|||ƒ}nBˆjƒ}x3|D]+\}}|tjd|||ƒƒ7}qzWtjd|ƒ} tjd|| ƒS(Ncsýtjƒ}|ˆjˆjˆ|tjƒ7}|ˆkrÜ|tjdƒ7}ˆj|ƒ}t|ƒdkr¼t|dtjƒr¼dj d„|Dƒƒ}|ˆjˆj ˆ|ƒ7}n ||7}|tjdƒ7}n|tjdƒ7}||7}|S(Ns (iiucss|]}|jƒVqdS(N(tastext(t.0tn((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pys ”st)s -- ( RRRRR5R#tpopRRtjoinR=(RRR9t fieldtypettypename(RRR&(s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyt handle_itemŠs " (  Rii( RR"RRR3R4R6R$R%( RR&RR7RFR(RRtbodynodeR)((RRR&s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyR*‰s #((N( R+R,R-RR/R0RRR*(((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyR;ns  tDocFieldTransformercBs2eZdZd„Zd„Zd„Zd„ZRS(s Transforms field lists in "doc field" syntax into better-looking equivalents, using the field type definitions given on a domain. cCsL|j|_d|jjkr<|j|jjƒ|j_n|j|_dS(Nt_doc_field_type_map(Rt __class__t__dict__tpreprocess_fieldtypestdoc_field_typesRIttypemap(Rt directive((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyR¯s cCsoi}xb|D]Z}x!|jD]}|tf||òst translatableN(NN(!RNR>tsplitR0t ValueErrortgetRtbooltupperRR#tappendR R tchildrentfiltert setdefaultR/tinlinet rawsourceRtparenttsourcetlineR.RR RPRR%R*Rt replace_self(RRRNtentriest groupindicesR&R%R(R)RDRttypedesct is_typefieldt new_fieldnameRERtargtypetargnamettranslatable_contenttgrouptentrytnew_listt fieldtypes((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyRQÇsx   " !       "           (R+R,R-RRLRSRQ(((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyRH©s   N( R-tdocutilsRtsphinxRR tobjectR R2R;RH(((s?/usr/local/lib/python2.7/site-packages/sphinx/util/docfields.pyt s +$;