;
Μβ"Ic               @   s  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z	 d  d l	 m
 Z
 d j   Z d j   Z d Z d   Z d   Z d   Z d	   Z Gd
   d e j  Z Gd   d e j  Z d   Z e d k o e   n d S(   i    N(   u	   pydoc_modu@  
NAME
    test.pydoc_mod - This is a test module for test_pydoc

FILE
    %s
%s
CLASSES
    builtins.object
        A
        B
    
    class A(builtins.object)
     |  Hello and goodbye
     |  
     |  Methods defined here:
     |  
     |  __init__()
     |      Wow, I have no function!
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __dict__
     |      dictionary for instance variables (if defined)
     |  
     |  __weakref__
     |      list of weak references to the object (if defined)
    
    class B(builtins.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
u¨  
<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="builtins.html#object">builtins.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#A">A</a>
</font></dt><dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#B">B</a>
</font></dt></dl>
</dd>
</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>(<a href="builtins.html#object">builtins.object</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>

<hr>
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>
</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="builtins.html#object">builtins.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>
u&   no Python documentation found for '%s'c             G   sL   t  j t j d j |  |  g } t j | d t j j j	   } | j
   S(   uW   
    Runs pydoc on the specified module. Returns the stripped
    output of pydoc.
    u    u   stdout(   u   sysu
   executableu   pydocu   __file__u   joinu
   subprocessu   Popenu   PIPEu   stdoutu   readu   strip(   u   module_nameu   argsu   cmdu   output(    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu	   run_pydocΊ   s    !!c             C   sZ   t  j   } | j |   } | j t  p d } | o d | d } n | j   | f S(   u&   Returns pydoc generated output as htmlu    u   <br><a href="u   ">Module Docs</a>(   u   pydocu   HTMLDocu	   docmoduleu	   getdoclocu	   pydoc_modu   strip(   u   moduleu   docu   outputu   loc(    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu   get_pydoc_htmlΓ   s    c             C   s{   t  j   } | j t  p d } | o d | d } n | j |   } t j d  } | j d |  } | j   | f S(   u&   Returns pydoc generated output as textu    u   
MODULE DOCS
    u   
u   .(	   u   pydocu   TextDocu	   getdoclocu	   pydoc_modu	   docmoduleu   reu   compileu   subu   strip(   u   moduleu   docu   locu   outputu   patt(    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu   get_pydoc_textΜ   s    c          	   C   s]   |  j  d
  } | j  d
  } t j | | d d d d d d } t d d j |   d	 S(   u"   Prints unified diffs for two textsu   ni    u   fromfileu   expectedu   tofileu   gotu   
u    NT(   u
   splitlinesu   Trueu   difflibu   unified_diffu   printu   join(   u   text1u   text2u   lines1u   lines2u   diffs(    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu   print_diffsΪ   s
    	c             B   s)   |  Ee  Z d    Z d   Z d   Z d S(   c             C   s   t  t  \ } } t j t  } t j d k o d d  l } | j |  } n | } t | | | f } | | k o t	 | |  |  j
 d  n d  S(   Nu   win32i    u%   outputs are not equal, see diff above(   u   get_pydoc_htmlu	   pydoc_modu   inspectu
   getabsfileu   sysu   platformu
   nturl2pathu   pathname2urlu   expected_html_patternu   print_diffsu   fail(   u   selfu   resultu   doc_locu   mod_fileu
   nturl2pathu   mod_urlu   expected_html(    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu   test_html_docε   s    c             C   sZ   t  t  \ } } t t j t  | f } | | k o t | |  |  j d  n d  S(   Nu%   outputs are not equal, see diff above(   u   get_pydoc_textu	   pydoc_modu   expected_text_patternu   inspectu
   getabsfileu   print_diffsu   fail(   u   selfu   resultu   doc_locu   expected_text(    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu   test_text_docς   s    c             C   s<   d } t  t |  d  } t | } |  j | | d  d  S(   Nu   test.i_am_not_hereu   asciiu&   documentation for missing module found(   u   stru	   run_pydocu   missing_patternu   assertEqual(   u   selfu   missing_moduleu   resultu   expected(    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu   test_not_hereϊ   s
    
N(   u   __name__u
   __module__u   test_html_docu   test_text_docu   test_not_here(   u
   __locals__(    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu   PyDocDocTestγ   s   
		u   PyDocDocTestc             B   s)   |  Ee  Z d    Z d   Z d   Z d S(   c             C   s6   d d l  m } t j |  } |  j d | k  d  S(   Ni    (   u   pydocfodderu   pydocfodder(   u   testu   pydocfodderu   pydocu
   render_docu   assert_(   u   selfu   pydocfodderu   doc(    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu   test_module  s    c             C   su   Gd   d  } |   } |  j  t j |  d  |  j  t j |  d  d t } |  j | t j |  k  d  S(   Nc             B   s   |  Ee  Z d  Z d S(   u   Classic classN(   u   __name__u
   __module__u   __doc__(   u
   __locals__(    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu   C  s   
 u   Cu   class Cu   C in module %s(   u   assertEqualu   pydocu   describeu   __name__u   assert_u
   render_doc(   u   selfu   Cu   cu   expected(    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu   test_classic_class
  s    	
c             C   sx   Gd   d t   } |   } |  j t j |  d  |  j t j |  d  d t } |  j | t j |  k  d  S(   Nc             B   s   |  Ee  Z d  Z d S(   u   New-style classN(   u   __name__u
   __module__u   __doc__(   u
   __locals__(    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu   C  s   
 u   Cu   class Cu   C in module %s object(   u   objectu   assertEqualu   pydocu   describeu   __name__u   assert_u
   render_doc(   u   selfu   Cu   cu   expected(    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu
   test_class  s    	
N(   u   __name__u
   __module__u   test_moduleu   test_classic_classu
   test_class(   u
   __locals__(    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu   TestDescriptions  s   
		u   TestDescriptionsc               C   s   t  j j t t  d  S(   N(   u   testu   supportu   run_unittestu   PyDocDocTestu   TestDescriptions(    (    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu	   test_main  s    u   __main__(   u   sysu   osu   difflibu
   subprocessu   reu   pydocu   inspectu   unittestu   test.supportu   testu	   pydoc_modu   stripu   expected_text_patternu   expected_html_patternu   missing_patternu	   run_pydocu   get_pydoc_htmlu   get_pydoc_textu   print_diffsu   TestCaseu   PyDocDocTestu   TestDescriptionsu	   test_mainu   __name__(    (    (    u,   /mit/python/lib/python3.0/test/test_pydoc.pyu   <module>   s*   De								