;ò
÷å–@c           @   s   d  Z  d Z d k Z d k Z d k l Z l Z d k l Z l	 Z	 e
 e i ƒ Z d e	 f d „  ƒ  YZ d e i f d „  ƒ  YZ d	 e	 f d
 „  ƒ  YZ d e	 f d „  ƒ  YZ d e	 f d „  ƒ  YZ d e	 f d „  ƒ  YZ d e	 f d „  ƒ  YZ d e	 f d „  ƒ  YZ d e	 f d „  ƒ  YZ d S(   s&   
Transforms for resolving references.
s   reStructuredTextN(   s   nodess   utils(   s   TransformErrors	   Transforms   ChainedTargetsc           B   s   t  Z d  Z d Z d „  Z RS(   s²   
    Attributes "refuri" and "refname" are migrated from the final direct
    target up the chain of contiguous adjacent internal targets, using
    `ChainedTargetResolver`.
    i¤  c         C   s#   t  |  i ƒ } |  i i | ƒ d  S(   N(   s   ChainedTargetResolvers   selfs   documents   visitors   walk(   s   selfs   visitor(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   apply    s    (   s   __name__s
   __module__s   __doc__s   default_prioritys   apply(    (    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   ChainedTargets   s    s   ChainedTargetResolverc           B   s    t  Z d  Z d „  Z d „  Z RS(   s  
    Copy reference attributes up the length of a hyperlink target chain.

    "Chained targets" are multiple adjacent internal hyperlink targets which
    "point to" an external or indirect target.  After the transform, all
    chained targets will effectively point to the same place.

    Given the following ``document`` as input::

        <document>
            <target id="a" name="a">
            <target id="b" name="b">
            <target id="c" name="c" refuri="http://chained.external.targets">
            <target id="d" name="d">
            <paragraph>
                I'm known as "d".
            <target id="e" name="e">
            <target id="id1">
            <target id="f" name="f" refname="d">

    ``ChainedTargetResolver(document).walk()`` will transform the above into::

        <document>
            <target id="a" name="a" refuri="http://chained.external.targets">
            <target id="b" name="b" refuri="http://chained.external.targets">
            <target id="c" name="c" refuri="http://chained.external.targets">
            <target id="d" name="d">
            <paragraph>
                I'm known as "d".
            <target id="e" name="e" refname="d">
            <target id="id1" refname="d">
            <target id="f" name="f" refname="d">
    c         C   s   d  S(   N(    (   s   selfs   node(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   unknown_visitI   s    c         C   s6  | i d ƒ o d } |  i i } nK | i d ƒ o d } |  i i } n% | i d ƒ o d } t } n d  S| | } | i
 i | ƒ } x£ t | d d d ƒ D]‹ } | i
 | } t | t i ƒ p- | i d ƒ p | i d ƒ p | i d ƒ o Pn | | | <| i d ƒ o | o | | ƒ q£ q£ Wd  S(   Ns   refuris   refnames   refidi   iÿÿÿÿs   name(   s   nodes   hasattrs   attnames   selfs   documents   note_external_targets   call_if_nameds   note_indirect_targets   Nones   attvals   parents   indexs   ranges   is   siblings
   isinstances   nodess   target(   s   selfs   nodes   call_if_nameds   indexs   is   attnames   siblings   attval(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   visit_targetL   s(    

 D
(   s   __name__s
   __module__s   __doc__s   unknown_visits   visit_target(    (    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   ChainedTargetResolver%   s   " 	s   AnonymousHyperlinksc           B   s   t  Z d  Z d Z d „  Z RS(   s¡  
    Link anonymous references to targets.  Given::

        <paragraph>
            <reference anonymous="1">
                internal
            <reference anonymous="1">
                external
        <target anonymous="1" id="id1">
        <target anonymous="1" id="id2" refuri="http://external">

    Corresponding references are linked via "refid" or resolved via "refuri"::

        <paragraph>
            <reference anonymous="1" refid="id1">
                text
            <reference anonymous="1" refuri="http://external">
                external
        <target anonymous="1" id="id1">
        <target anonymous="1" id="id2" refuri="http://external">
    i¸  c         C   s_  t  |  i i ƒ t  |  i i ƒ j o¸ |  i i i d t  |  i i ƒ t  |  i i ƒ f ƒ } |  i i | ƒ } xd |  i i D]V } t i | i | i d | ƒ} |  i i | ƒ } | i | ƒ | i i | | ƒ q{ Wd  Sn x{ t |  i i |  i i ƒ D]^ \ } } | i d ƒ o | d | d <d | _ n | d | d <|  i i | ƒ d | _ qù Wd  S(   Ns]   Anonymous hyperlink mismatch: %s references but %s targets.
See "backrefs" attribute for IDs.s   refids   refurii   s   id(   s   lens   selfs   documents   anonymous_refss   anonymous_targetss   reporters   errors   msgs   set_ids   msgids   refs   nodess   problematics	   rawsources   prbs   prbids   add_backrefs   parents   replaces   zips   targets   hasattrs   resolveds
   note_refids
   referenced(   s   selfs   targets   prbs   msgids   prbids   msgs   ref(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   apply€   s&    %7  (   s   __name__s
   __module__s   __doc__s   default_prioritys   apply(    (    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   AnonymousHyperlinksf   s    s   IndirectHyperlinksc           B   sJ   t  Z d  Z d Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   sN  
    a) Indirect external references::

           <paragraph>
               <reference refname="indirect external">
                   indirect external
           <target id="id1" name="direct external"
               refuri="http://indirect">
           <target id="id2" name="indirect external"
               refname="direct external">

       The "refuri" attribute is migrated back to all indirect targets
       from the final direct target (i.e. a target not referring to
       another indirect target)::

           <paragraph>
               <reference refname="indirect external">
                   indirect external
           <target id="id1" name="direct external"
               refuri="http://indirect">
           <target id="id2" name="indirect external"
               refuri="http://indirect">

       Once the attribute is migrated, the preexisting "refname" attribute
       is dropped.

    b) Indirect internal references::

           <target id="id1" name="final target">
           <paragraph>
               <reference refname="indirect internal">
                   indirect internal
           <target id="id2" name="indirect internal 2"
               refname="final target">
           <target id="id3" name="indirect internal"
               refname="indirect internal 2">

       Targets which indirectly refer to an internal target become one-hop
       indirect (their "refid" attributes are directly set to the internal
       target's "id"). References which indirectly refer to an internal
       target become direct internal references::

           <target id="id1" name="final target">
           <paragraph>
               <reference refid="id1">
                   indirect internal
           <target id="id2" name="indirect internal 2" refid="id1">
           <target id="id3" name="indirect internal" refid="id1">
    iÌ  c         C   sD   x= |  i i D]/ } | i o |  i | ƒ n |  i | ƒ q Wd  S(   N(   s   selfs   documents   indirect_targetss   targets   resolveds   resolve_indirect_targets   resolve_indirect_references(   s   selfs   target(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   applyÑ   s
     c         C   sÉ  | d } |  i i i | ƒ } | oA x6 |  i i i D] } | | ƒ o Pq7 q7 W|  i
 | ƒ d  Sn |  i i | } t | t i  ƒ o | i o | i d ƒ oE t | d ƒ o |  i | ƒ d  Sn d | _ |  i | ƒ | ` n | i d ƒ o6 | d | d <| i d ƒ o |  i i | ƒ q¬n| | i d ƒ o" | d | d <|  i i | ƒ nJ y" | d | d <|  i i | ƒ Wn$ t j
 o |  i
 | ƒ d  Sn X| d =d | _ d | _ d  S(   Ns   refnames   multiply_indirecti   s   refuris   names   refids   id(   s   targets   refnames   selfs   documents   nameidss   gets   reftarget_ids   transformers   unknown_reference_resolverss   resolver_functions   nonexistent_indirect_targets   idss	   reftargets
   isinstances   nodess   resolveds   hasattrs   circular_indirect_references   multiply_indirects   resolve_indirect_targets   note_external_targets
   note_refids   KeyErrors
   referenced(   s   selfs   targets   resolver_functions	   reftargets   refnames   reftarget_id(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   resolve_indirect_target×   sB    
 	.	
		c         C   sB   |  i i i | d ƒ o |  i | d ƒ n |  i | d ƒ d  S(   Ns   refnames>   which is a duplicate, and cannot be used as a unique references   which does not exist(   s   selfs   documents   nameidss   has_keys   targets   indirect_target_error(   s   selfs   target(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   nonexistent_indirect_target   s    c         C   s   |  i | d ƒ d  S(   Ns   forming a circular reference(   s   selfs   indirect_target_errors   target(   s   selfs   target(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   circular_indirect_reference  s    c   
      C   s  d } | i d ƒ o. d | d } |  i i i | d g  ƒ } n |  i i i | d g  ƒ } | d | d 7} |  i i	 i
 d | | d | f d | ƒ} |  i i | ƒ } x^ | D]V }	 t i |	 i |	 i d	 | ƒ} |  i i | ƒ } | i | ƒ |	 i i |	 | ƒ q· Wd
 | _ d  S(   Ns    s   names   "%s" s   ids	   (id="%s")s7   Indirect hyperlink target %s refers to target "%s", %s.s   refnames	   base_nodes   refidi   (   s   namings   targets   hasattrs   selfs   documents   refnamess   gets   reflists   refidss   reporters   errors   explanations   msgs   set_ids   msgids   refs   nodess   problematics	   rawsources   prbs   prbids   add_backrefs   parents   replaces   resolved(
   s   selfs   targets   explanations   reflists   prbs   msgids   prbids   msgs   namings   ref(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   indirect_target_error
  s        c         C   s  | i d ƒ o d } d } |  i i } n1 | i d ƒ o d } d } |  i i } n d  S| | } | i d ƒ o~ | d } y |  i i | } WnS t j
 oG } | i o d  Sn |  i i i d | d | ƒ} d | _ d  Sn Xd }	 n{ | d	 } y |  i i | } WnS t j
 oG } | i o d  Sn |  i i i d
 | d | ƒ} d | _ d  Sn Xd }	 xƒ | D]{ }
 |
 i o qun |
 |	 =| |
 | <| p |
 i d ƒ o | |
 ƒ n d |
 _ t |
 t i  ƒ o |  i |
 ƒ ququWd | _ d  S(   Ns   refidi    s   refurii   s   names1   Indirect hyperlink target "%s" is not referenced.s	   base_nodes   refnames   ids4   Indirect hyperlink target id="%s" is not referenced.(   s   targets   hasattrs   attnames   call_if_nameds   selfs   documents
   note_refids   call_methods   note_external_targets   attvals   names   refnamess   reflists   KeyErrors   instances
   referenceds   reporters   infos   msgs   delatts   ids   refidss   refs   resolveds
   isinstances   nodess   resolve_indirect_references(   s   selfs   targets   attvals   call_if_nameds   call_methods   reflists   attnames   instances   msgs   delatts   refs   ids   name(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   resolve_indirect_references  sZ    


		


		 

	(
   s   __name__s
   __module__s   __doc__s   default_prioritys   applys   resolve_indirect_targets   nonexistent_indirect_targets   circular_indirect_references   indirect_target_errors   resolve_indirect_references(    (    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   IndirectHyperlinks›   s   2 		)			s   ExternalTargetsc           B   s   t  Z d  Z d Z d „  Z RS(   s¸  
    Given::

        <paragraph>
            <reference refname="direct external">
                direct external
        <target id="id1" name="direct external" refuri="http://direct">

    The "refname" attribute is replaced by the direct "refuri" attribute::

        <paragraph>
            <reference refuri="http://direct">
                direct external
        <target id="id1" name="direct external" refuri="http://direct">
    i€  c         C   s  x|  i i D]ÿ } | i d ƒ o | i d ƒ oÙ | d } | d } y |  i i | } Wne t	 j
 oY } t | t i ƒ p | i o q n |  i i i d | d | ƒ} d | _ q n Xx9 | D]1 } | i o qÊ n | d =| | d <d | _ qÊ Wd | _ q q Wd  S(   Ns   refuris   names1   External hyperlink target "%s" is not referenced.s	   base_nodei   s   refname(   s   selfs   documents   external_targetss   targets   hasattrs   names   refuris   refnamess   reflists   KeyErrors   instances
   isinstances   nodess
   referenceds   reporters   infos   msgs   refs   resolved(   s   selfs   reflists   targets   instances   refuris   msgs   refs   name(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   applyf  s,      

	 

(   s   __name__s
   __module__s   __doc__s   default_prioritys   apply(    (    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   ExternalTargetsR  s    s   InternalTargetsc           B   s   t  Z d  Z d Z d „  Z RS(   sŠ  
    Given::

        <paragraph>
            <reference refname="direct internal">
                direct internal
        <target id="id1" name="direct internal">

    The "refname" attribute is replaced by "refid" linking to the target's
    "id"::

        <paragraph>
            <reference refid="id1">
                direct internal
        <target id="id1" name="direct internal">
    i”  c         C   s  x|  i i D]ÿ } | i d ƒ p | i d ƒ p | i d ƒ o q n | d } | d } y |  i i | } WnQ t	 j
 oE } | i o q n |  i i i d | d | ƒ} d | _ q n Xx9 | D]1 } | i o qÎ n | d =| | d <d | _ qÎ Wd | _ q Wd  S(	   Ns   refuris   refids   names   ids1   Internal hyperlink target "%s" is not referenced.s	   base_nodei   s   refname(   s   selfs   documents   internal_targetss   targets   hasattrs   names   refids   refnamess   reflists   KeyErrors   instances
   referenceds   reporters   infos   msgs   refs   resolved(   s   selfs   reflists   targets   instances   msgs   refs   refids   name(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   apply”  s.     1


	 

(   s   __name__s
   __module__s   __doc__s   default_prioritys   apply(    (    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   InternalTargets  s    s	   Footnotesc        
   B   st   t  Z d  Z d Z e Z d d d d d d d d	 d
 d g
 Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z RS(   sè  
    Assign numbers to autonumbered footnotes, and resolve links to footnotes,
    citations, and their references.

    Given the following ``document`` as input::

        <document>
            <paragraph>
                A labeled autonumbered footnote referece:
                <footnote_reference auto="1" id="id1" refname="footnote">
            <paragraph>
                An unlabeled autonumbered footnote referece:
                <footnote_reference auto="1" id="id2">
            <footnote auto="1" id="id3">
                <paragraph>
                    Unlabeled autonumbered footnote.
            <footnote auto="1" id="footnote" name="footnote">
                <paragraph>
                    Labeled autonumbered footnote.

    Auto-numbered footnotes have attribute ``auto="1"`` and no label.
    Auto-numbered footnote_references have no reference text (they're
    empty elements). When resolving the numbering, a ``label`` element
    is added to the beginning of the ``footnote``, and reference text
    to the ``footnote_reference``.

    The transformed result will be::

        <document>
            <paragraph>
                A labeled autonumbered footnote referece:
                <footnote_reference auto="1" id="id1" refid="footnote">
                    2
            <paragraph>
                An unlabeled autonumbered footnote referece:
                <footnote_reference auto="1" id="id2" refid="id3">
                    1
            <footnote auto="1" id="id3" backrefs="id2">
                <label>
                    1
                <paragraph>
                    Unlabeled autonumbered footnote.
            <footnote auto="1" id="footnote" name="footnote" backrefs="id1">
                <label>
                    2
                <paragraph>
                    Labeled autonumbered footnote.

    Note that the footnotes are not in the same order as the references.

    The labels and reference text are added to the auto-numbered ``footnote``
    and ``footnote_reference`` elements.  Footnote elements are backlinked to
    their references via "refids" attributes.  References are assigned "id"
    and "refid" attributes.

    After adding labels and reference text, the "auto" attributes can be
    ignored.
    il  s   *u   â€ u   â€¡u   Â§u   Â¶s   #u   â™ u   â™¥u   â™¦u   â™£c         C   sO   g  |  _ |  i i } |  i | ƒ |  i _ |  i | ƒ |  i ƒ  |  i ƒ  d  S(   N(	   s   selfs   autofootnote_labelss   documents   autofootnote_starts   startnums   number_footnotess   number_footnote_referencess   symbolize_footnotess   resolve_footnotes_and_citations(   s   selfs   startnum(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   apply  s    	
c         C   sY  xN|  i i D]@} x> n o6 t | ƒ } | d 7} |  i i i | ƒ o Pq q W| i	 d t
 i d | ƒ ƒ | i d ƒ o q n | i d ƒ o‰ | d } x© |  i i i | g  ƒ D]^ } | t
 i | ƒ 7} | i d ƒ | d | d <| i | d ƒ |  i i | ƒ d | _ qº Wq | | d <|  i i | | ƒ |  i i | ƒ q W| Sd	 S(
   s«   
        Assign numbers to autonumbered footnotes.

        For labeled autonumbered footnotes, copy the number over to
        corresponding footnote references.
        i   i    s    s   dupnames   names   refnames   ids   refidN(   s   selfs   documents   autofootnotess   footnotes   strs   startnums   labels   nameidss   has_keys   inserts   nodess   hasattrs   names   footnote_refss   gets   refs   Texts   delattrs   add_backrefs
   note_refids   resolveds   note_explicit_targets   autofootnote_labelss   append(   s   selfs   startnums   names   footnotes   labels   ref(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   number_footnotes	  s4       


 
c         C   s¡  d } x”|  i i D]†}	 |	 i p |	 i d ƒ o q n y |  i | } WnÚ t	 j
 oÎ |  i i
 i d t |  i ƒ d |	 ƒ} |  i i | ƒ } x‰ |  i i | D]w }	 |	 i p |	 i d ƒ o q§ n t i |	 i |	 i d | ƒ} |  i i | ƒ } | i | ƒ |	 i i |	 | ƒ q§ WPn X|	 t i | ƒ 7}	 |  i i | }
 |  i i |
 } |
 |	 d <|  i i |	 ƒ | i |	 d ƒ d |	 _ | d 7} q Wd S(	   s3   Assign numbers to autonumbered footnote references.i    s   refidsU   Too many autonumbered footnote references: only %s corresponding footnotes available.s	   base_nodes   refnames   idi   N(   s   is   selfs   documents   autofootnote_refss   refs   resolveds   hasattrs   autofootnote_labelss   labels
   IndexErrors   reporters   errors   lens   msgs   set_ids   msgids   nodess   problematics	   rawsources   prbs   prbids   add_backrefs   parents   replaces   Texts   nameidss   ids   idss   footnotes
   note_refid(   s   selfs   startnums   prbs   is   msgids   labels   footnotes   prbids   msgs   refs   id(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   number_footnote_references(  s:       
	c         C   s   g  } x˜ |  i i D]Š } t |  i i t |  i ƒ ƒ \ } } |  i | | d } | i | ƒ | i d t i d | ƒ ƒ |  i i d 7_ |  i i | ƒ q Wd } xR|  i i D]D}
 y |
 t i | | ƒ 7}
 Wn× t j
 oË |  i i i d t | ƒ d |
 ƒ}	 |  i i |	 ƒ } x‰ |  i i | D]w }
 |
 i p |
 i d ƒ o q.n t i |
 i |
 i d | ƒ} |  i i | ƒ } |	 i  | ƒ |
 i! i" |
 | ƒ q.WPn X|  i i | } | d |
 d <|  i i# |
 ƒ | i  |
 d ƒ | d 7} q´ Wd S(	   s<   Add symbols indexes to "[*]"-style footnotes and references.i   i    s    sO   Too many symbol footnote references: only %s corresponding footnotes available.s	   base_nodes   refids   idN($   s   labelss   selfs   documents   symbol_footnotess   footnotes   divmods   symbol_footnote_starts   lens   symbolss   repss   indexs	   labeltexts   appends   inserts   nodess   labels   set_ids   is   symbol_footnote_refss   refs   Texts
   IndexErrors   reporters   errors   msgs   msgids   resolveds   hasattrs   problematics	   rawsources   prbs   prbids   add_backrefs   parents   replaces
   note_refid(   s   selfs   indexs	   labeltexts   prbs   footnotes   msgids   labelss   repss   is   msgs   refs   prbid(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   symbolize_footnotesH  sD        c         C   sº   xX |  i i D]J } | d } |  i i i | ƒ o$ |  i i | } |  i | | ƒ q q WxX |  i i	 D]J } | d } |  i i i | ƒ o$ |  i i | } |  i | | ƒ qh qh Wd S(   sa   
        Link manually-labeled footnotes and citations to/from their
        references.
        s   nameN(   s   selfs   documents	   footnotess   footnotes   labels   footnote_refss   has_keys   reflists   resolve_referencess	   citationss   citations   citation_refs(   s   selfs   footnotes   citations   reflists   label(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   resolve_footnotes_and_citationsl  s      
 
c         C   sj   | d } xP | D]H } | i o q n | i d ƒ | | d <| i | d ƒ d | _ q Wd | _ d  S(   Ns   ids   refnames   refidi   (   s   notes   ids   reflists   refs   resolveds   delattrs   add_backref(   s   selfs   notes   reflists   refs   id(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   resolve_references|  s    
 

(   s   __name__s
   __module__s   __doc__s   default_prioritys   Nones   autofootnote_labelss   symbolss   applys   number_footnotess   number_footnote_referencess   symbolize_footnotess   resolve_footnotes_and_citationss   resolve_references(    (    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys	   Footnotes®  s   ;  $			 	$	s   Substitutionsc           B   s   t  Z d  Z d Z d „  Z RS(   sD  
    Given the following ``document`` as input::

        <document>
            <paragraph>
                The
                <substitution_reference refname="biohazard">
                    biohazard
                 symbol is deservedly scary-looking.
            <substitution_definition name="biohazard">
                <image alt="biohazard" uri="biohazard.png">

    The ``substitution_reference`` will simply be replaced by the
    contents of the corresponding ``substitution_definition``.

    The transformed result will be::

        <document>
            <paragraph>
                The
                <image alt="biohazard" uri="biohazard.png">
                 symbol is deservedly scary-looking.
            <substitution_definition name="biohazard">
                <image alt="biohazard" uri="biohazard.png">
    iÜ   c         C   sU  |  i i } |  i i } x*|  i i i ƒ  D]\ } } x| D]ÿ }
 t } | i | ƒ o
 | } n+ | i ƒ  }	 | i |	 ƒ o | |	 } n | t j o… |  i i i d | d |
 ƒ} |  i i | ƒ } t i |
 i |
 i d | ƒ} |  i i | ƒ } | i | ƒ |
 i i |
 | ƒ q> |
 i i |
 | | i ƒ  ƒ q> Wq+ Wt |  i _ d  S(   Ns(   Undefined substitution referenced: "%s".s	   base_nodes   refid(   s   selfs   documents   substitution_defss   defss   substitution_namess   normeds   substitution_refss   itemss   refnames   refss   refs   Nones   keys   has_keys   lowers   normed_names   reporters   errors   msgs   set_ids   msgids   nodess   problematics	   rawsources   prbs   prbids   add_backrefs   parents   replaces   get_children(   s   selfs   defss   normeds   prbs   msgids   refnames   prbids   keys   msgs   normed_names   refs   refs(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   apply¨  s,      
%(   s   __name__s
   __module__s   __doc__s   default_prioritys   apply(    (    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   Substitutionsˆ  s     s   TargetNotesc           B   s&   t  Z d  Z d Z d „  Z d „  Z RS(   s‚   
    Creates a footnote for each external target in the text, and corresponding
    footnote references after each reference.
    i  c         C   s”  h  } g  } x³ |  i i D]¥ } | i d ƒ } | o t i	 d | IJq n |  i i
 i | g  ƒ } | o q n |  i | | | ƒ } | i | d ƒ o | | | d <| i | ƒ q q Wt |  i i ƒ t |  i i ƒ j o x t |  i i |  i i ƒ D]l \ } } | i d ƒ oP |  i | | g | ƒ } | i | d ƒ o | | | d <| i | ƒ qoqqWn |  i i i |  i | ƒ d  S(   Ns   names   no name on target: %rs   refuri(   s   notess   nodelists   selfs   documents   external_targetss   targets   gets   names   syss   stderrs   refnamess   refss   make_target_footnotes   footnotes   has_keys   appends   lens   anonymous_targetss   anonymous_refss   zips   refs   hasattrs	   startnodes   parents   replace(   s   selfs   nodelists   names   footnotes   refs   notess   refss   target(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   applyÎ  s2     % c         C   sŽ  | d }	 | i |	 ƒ o | |	 } | d } n’ t i ƒ  } |  i i	 | ƒ }
 d |
 } d | d <| | d <t i ƒ  } | t i d |	 d |	 ƒ7} | | 7} |  i i | ƒ |  i i | | ƒ xÀ | D]¸ } t | t i  ƒ o qÊ n t i d | d d ƒ } |  i i | ƒ |  i i | ƒ | i i | ƒ d } | g } |  i i i o | i d t i d	 ƒ ƒ n | i i | | ƒ qÊ W| Sd  S(
   Ns   refuris   names   target_note: i   s   autos    s   refnamei    s    (   s   targets   refuris   notess   has_keys   footnotes   footnote_names   nodess   selfs   documents   set_ids   footnote_ids	   paragraphs   footnote_paragraphs	   references   note_autofootnotes   note_explicit_targets   refss   refs
   isinstances   footnote_references   refnodes   note_autofootnote_refs   note_footnote_refs   parents   indexs   reflists   settingss   trim_footnote_reference_spaces   inserts   Text(   s   selfs   targets   refss   notess   indexs   reflists   footnote_names   footnotes   refnodes   refuris   footnote_ids   footnote_paragraphs   ref(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   make_target_footnoteè  s6    





 	(   s   __name__s
   __module__s   __doc__s   default_prioritys   applys   make_target_footnote(    (    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   TargetNotesÃ  s
     	(   s   __doc__s   __docformat__s   syss   res   docutilss   nodess   utilss   docutils.transformss   TransformErrors	   Transforms   xranges   maxints   indicess   ChainedTargetss   SparseNodeVisitors   ChainedTargetResolvers   AnonymousHyperlinkss   IndirectHyperlinkss   ExternalTargetss   InternalTargetss	   Footnotess   Substitutionss   TargetNotes(   s   TransformErrors   ChainedTargetResolvers   AnonymousHyperlinkss   ExternalTargetss   utilss	   Transforms   __docformat__s   Substitutionss   syss   res   ChainedTargetss   InternalTargetss   TargetNotess   indicess   IndirectHyperlinkss   nodess	   Footnotes(    (    sS   /mit/golem/arch/share/lib/python2.3/site-packages/docutils/transforms/references.pys   ?	   s   		A5·-/Ú;