Ńň
ŕ"Ic           @   s  d  d k  Z  d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z	 d  d k	 l
 Z
 d i   Z d i   Z d Z d   Z d   Z d   Z d	   Z d
 e i f d     YZ d e i f d     YZ d   Z e d j o e   n d S(   i˙˙˙˙N(   t	   pydoc_mods  
NAME
    test.pydoc_mod - This is a test module for test_pydoc

FILE
    %s
%s
CLASSES
    __builtin__.object
        B
    A
    
    class A
     |  Hello and goodbye
     |  
     |  Methods defined here:
     |  
     |  __init__()
     |      Wow, I have no function!
    
    class B(__builtin__.object)
     |  Data descriptors defined here:
     |  
     |  __dict__
     |      dictionary for instance variables (if defined)
     |  
     |  __weakref__
     |      list of weak references to the object (if defined)
     |  
     |  ----------------------------------------------------------------------
     |  Data and other attributes defined here:
     |  
     |  NO_MEANING = 'eggs'

FUNCTIONS
    doc_func()
        This function solves all of the world's problems:
        hunger
        lack of Python
        war
    
    nodoc_func()

DATA
    __author__ = 'Benjamin Peterson'
    __credits__ = 'Nobody'
    __version__ = '1.2.3.4'

VERSION
    1.2.3.4

AUTHOR
    Benjamin Peterson

CREDITS
    Nobody
s4  
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="test.html"><font color="#ffffff">test</font></a>.pydoc_mod</strong></big></big> (version 1.2.3.4)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:%s">%s</a>%s</font></td></tr></table>
    <p><tt>This&nbsp;is&nbsp;a&nbsp;test&nbsp;module&nbsp;for&nbsp;test_pydoc</tt></p>
<p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#B">B</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#A">A</a>
</font></dt></dl>
 <p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="A">class <strong>A</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Hello&nbsp;and&nbsp;goodbye<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%%">Methods defined here:<br>
<dl><dt><a name="A-__init__"><strong>__init__</strong></a>()</dt><dd><tt>Wow,&nbsp;I&nbsp;have&nbsp;no&nbsp;function!</tt></dd></dl>

</td></tr></table> <p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="B">class <strong>B</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%">Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>NO_MEANING</strong> = 'eggs'</dl>

</td></tr></table></td></tr></table><p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%"><dl><dt><a name="-doc_func"><strong>doc_func</strong></a>()</dt><dd><tt>This&nbsp;function&nbsp;solves&nbsp;all&nbsp;of&nbsp;the&nbsp;world's&nbsp;problems:<br>
hunger<br>
lack&nbsp;of&nbsp;Python<br>
war</tt></dd></dl>
 <dl><dt><a name="-nodoc_func"><strong>nodoc_func</strong></a>()</dt></dl>
</td></tr></table><p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%"><strong>__author__</strong> = 'Benjamin Peterson'<br>
<strong>__credits__</strong> = 'Nobody'<br>
<strong>__version__</strong> = '1.2.3.4'</td></tr></table><p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%">Benjamin&nbsp;Peterson</td></tr></table><p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Credits</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%%">Nobody</td></tr></table>
s&   no Python documentation found for '%s'c         G   sL   t  i t i d i |  |  g } t i | d t i i i	   } | i
   S(   sW   
    Runs pydoc on the specified module. Returns the stripped
    output of pydoc.
    t    t   stdout(   t   syst
   executablet   pydoct   __file__t   joint
   subprocesst   Popent   PIPER   t   readt   strip(   t   module_namet   argst   cmdt   output(    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyt	   run_pydocŠ   s    !!c         C   sZ   t  i   } | i |   } | i t  p d } | o d | d } n | i   | f S(   s&   Returns pydoc generated output as htmlt    s   <br><a href="s   ">Module Docs</a>(   R   t   HTMLDoct	   docmodulet	   getdoclocR    R   (   t   modulet   docR   t   loc(    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyt   get_pydoc_html˛   s    c         C   s{   t  i   } | i t  p d } | o d | d } n | i |   } t i d  } | i d |  } | i   | f S(   s&   Returns pydoc generated output as textR   s   
MODULE DOCS
    s   
s   .(	   R   t   TextDocR   R    R   t   ret   compilet   subR   (   R   R   R   R   t   patt(    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyt   get_pydoc_textť   s    c      	   C   sX   |  i  t  } | i  t  } t i | | d d d d d d } d d i |  GHd	 S(
   s"   Prints unified diffs for two textst   ni    t   fromfilet   expectedt   tofilet   gots   
R   N(   t
   splitlinest   Truet   difflibt   unified_diffR   (   t   text1t   text2t   lines1t   lines2t   diffs(    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyt   print_diffsÉ   s
    	t   PyDocDocTestc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s   t  t  \ } } t i t  } t i d j o d d  k } | i |  } n | } t | | | f } | | j o t	 | |  |  i
 d  n d  S(   Nt   win32i˙˙˙˙s%   outputs are not equal, see diff above(   R   R    t   inspectt
   getabsfileR   t   platformt
   nturl2patht   pathname2urlt   expected_html_patternR.   t   fail(   t   selft   resultt   doc_loct   mod_fileR4   t   mod_urlt   expected_html(    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyt   test_html_docÔ   s    c         C   sZ   t  t  \ } } t t i t  | f } | | j o t | |  |  i d  n d  S(   Ns%   outputs are not equal, see diff above(   R   R    t   expected_text_patternR1   R2   R.   R7   (   R8   R9   R:   t   expected_text(    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyt   test_text_docá   s    c         C   s3   d } t  |  } t | } |  i | | d  d  S(   Ns   test.i_am_not_heres&   documentation for missing module found(   R   t   missing_patternt   assertEqual(   R8   t   missing_moduleR9   R"   (    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyt   test_not_hereé   s
    
(   t   __name__t
   __module__R>   RA   RE   (    (    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyR/   Ň   s   		t   TestDescriptionsc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s6   d d k  l } t i |  } |  i d | j  d  S(   Ni˙˙˙˙(   t   pydocfodderRI   (   t   testRI   R   t
   render_doct   assert_(   R8   RI   R   (    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyt   test_moduleó   s    c         C   sx   d d d     Y} |   } |  i  t i |  d  |  i  t i |  d  d t } |  i | t i |  j  d  S(   Nt   Cc           B   s   e  Z d  Z RS(   s   Classic class(   RF   RG   t   __doc__(    (    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyRN   ú   s    s   class Cs   instance of Cs   instance of C in module %s(    (   RC   R   t   describeRF   RL   RK   (   R8   RN   t   cR"   (    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyt   test_classic_classů   s    	
c         C   s{   d t  f d     Y} |   } |  i t i |  d  |  i t i |  d  d t } |  i | t i |  j  d  S(   NRN   c           B   s   e  Z d  Z RS(   s   New-style class(   RF   RG   RO   (    (    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyRN     s    s   class Cs   C in module %s object(   t   objectRC   R   RP   RF   RL   RK   (   R8   RN   RQ   R"   (    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyt
   test_class  s    	
(   RF   RG   RM   RR   RT   (    (    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyRH   ń   s   		c           C   s   t  i i t t  d  S(   N(   RJ   t   test_supportt   run_unittestR/   RH   (    (    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyt	   test_main  s    t   __main__(   R   t   osR'   R   R   R   R1   t   unittestt   test.test_supportRJ   R    R   R?   R6   RB   R   R   R   R.   t   TestCaseR/   RH   RW   RF   (    (    (    s,   /mit/python/lib/python2.6/test/test_pydoc.pyt   <module>   s*   ;]								