
bc           @   s8  d  Z  d Z d Z d Z d 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 Z d d l m Z d d l m Z m Z m Z m Z m Z m Z m Z m Z d d	 l m Z y d d
 l m Z Wn' e k
 r!d e f d     YZ n Xd   Z d   Z  d   Z! d   Z" d   Z# d   Z$ d   Z% e j& d e j'  Z( d   Z) d   Z* d   Z+ d   Z, e- e- d  Z. d   Z/ y
 e0 Z1 Wn9 e2 k
 rd e3 f d     YZ1 d Z4 d d  Z5 n% Xd d l6 Z6 e6 j7   Z4 e- d  Z5 d    Z8 d!   Z9 d"   Z: i  d#  Z; d$ e< f d%     YZ= d&   Z> d' i  d(  Z? d) f  d*     YZ@ d+ e f d,     YZA d- e@ f d.     YZB d/ e f d0     YZC d1 e@ f d2     YZD d3   aE d4   ZF d5   ZG d6   ZH d7   ZI d8   ZJ d9   ZK d:   ZL d' d;  ZM eD   ZN eB   ZO d< f  d=     YZP eQ eP    ZR d' d>  ZS d? d' d@  ZT d? d' dA  ZU d' dB  ZV dC e- dD  ZW dE f  dF     YZX eX   ZY dG f  dH     YZZ dI f  dJ     YZ[ dK   Z\ e- e- dL  Z] dM   Z^ dN   Z_ dO   Z` ea dP k r4e`   n  d S(Q   sO  Generate Python documentation in HTML or text for interactive use.

In the Python interpreter, do "from pydoc import help" to provide online
help.  Calling help(thing) on a Python object documents the object.

Or, at the shell command line outside of Python:

Run "pydoc <name>" to show documentation on something.  <name> may be
the name of a function, module, package, or a dotted reference to a
class or function within a module or module in a package.  If the
argument contains a path segment delimiter (e.g. slash on Unix,
backslash on Windows) it is treated as the path to a Python source file.

Run "pydoc -k <keyword>" to search for a keyword in the synopsis lines
of all available modules.

Run "pydoc -p <port>" to start an HTTP server on a given port on the
local machine to generate documentation web pages.  Port number 0 can be
used to get an arbitrary unused port.

For platforms without a command line, "pydoc -g" starts the HTTP server
and also pops up a little window for controlling it.

Run "pydoc -w <name>" to write out the HTML documentation for a module
to a file named "<name>.html".

Module docs for core modules are assumed to be in

    https://docs.python.org/library/

This can be overridden by setting the PYTHONDOCS environment variable
to a different URL or to a local directory containing the Library
Reference Manual pages.
s   Ka-Ping Yee <ping@lfw.org>s   26 February 2001s   $Revision: 88564 $s   Guido van Rossum, for an excellent programming language.
Tommy Burnette, the original creator of manpy.
Paul Prescod, for all his work on onlinehelp.
Richard Chamberlain, for the first implementation of textdoc.
iN(   t   Repr(   t
   expandtabst   findt   joint   lowert   splitt   stript   rfindt   rstrip(   t
   extract_tb(   t   dequeR
   c           B   s   e  Z d    Z RS(   c         C   s   |  j  d  S(   Ni    (   t   pop(   t   self(    (    s   /usr/lib/python2.7/pydoc.pyt   popleftA   s    (   t   __name__t
   __module__R   (    (    (    s   /usr/lib/python2.7/pydoc.pyR
   @   s   c          C   s   g  }  g  } xv t  j D]k } t j j | p. d  } t j j |  } | | k r t j j |  r |  j |  | j |  q q W|  S(   sA   Convert sys.path into a list of absolute, existing, unique paths.t   .(   t   syst   patht   ost   abspatht   normcaset   isdirt   append(   t   dirst   normdirst   dirt   normdir(    (    s   /usr/lib/python2.7/pydoc.pyt   pathdirsF   s    c         C   sO   t  j |   p t  j |   } t |  } | rK t j d d t |   pN d S(   s-   Get the doc string or comments for an object.s   ^ *
t    (   t   inspectt   getdoct   getcommentst   _encodet   ret   subR   (   t   objectt   result(    (    s   /usr/lib/python2.7/pydoc.pyR   R   s    c         C   s   t  t |   d  } t |  d k r5 | d d f St |  d k rs t | d  rs | d t | d d  f Sd t | d  f S(   s>   Split a doc string into a synopsis line (if any) and the rest.s   
i   i    R   i   (   R   R   t   lenR   R   (   t   doct   lines(    (    s   /usr/lib/python2.7/pydoc.pyt   splitdocX   s    #c         C   s0   |  j  } |  j | k r, |  j d | } n  | S(   s@   Get a class name and qualify it with a module name if necessary.R   (   R   R   (   R$   t   modnamet   name(    (    s   /usr/lib/python2.7/pydoc.pyt	   classnamea   s    	c         C   sY   t  j |   pW t  j |   pW t  j |   pW t  j |   pW t  j |   pW t  j |   S(   s>   Check if an object is of a type that probably means it's data.(   R   t   ismodulet   isclasst	   isroutinet   isframet   istracebackt   iscode(   R$   (    (    s   /usr/lib/python2.7/pydoc.pyt   isdatah   s    c         G   s;   x4 | r6 t  t |  | d  | d  }  | d } q W|  S(   s/   Do a series of global replacements on a string.i    i   i   (   R   R   (   t   textt   pairs(    (    s   /usr/lib/python2.7/pydoc.pyt   replacen   s    	 c         C   sb   t  |   | k r^ t d | d d  } t d | d |  } |  |  d |  t  |   | S|  S(   sC   Omit part of a string if needed to make it fit in a maximum length.i    i   i   s   ...(   R&   t   max(   R4   t   maxlent   pret   post(    (    s   /usr/lib/python2.7/pydoc.pyt   cramu   s
    s    at 0x[0-9a-f]{6,16}(>+)$c         C   s   t  j d |   S(   s>   Remove the hexadecimal id from a Python object representation.s   \1(   t   _re_stripidR#   (   R4   (    (    s   /usr/lib/python2.7/pydoc.pyt   stripid~   s    c         C   s   t  j |   p t  j |   S(   N(   R   t   ismethodt   ismethoddescriptor(   t   obj(    (    s   /usr/lib/python2.7/pydoc.pyt   _is_some_method   s    c         C   s   i  } x* t  j |  t  D] \ } } d | | <q Wx$ |  j D] } | j t |   q= Wx' | j   D] } t |  |  | | <qg W| S(   Ni   (   R   t
   getmembersRA   t	   __bases__t   updatet
   allmethodst   keyst   getattr(   t   clt   methodst   keyt   valuet   base(    (    s   /usr/lib/python2.7/pydoc.pyRE      s    c         C   sP   g  } g  } x7 |  D]/ } | |  r5 | j  |  q | j  |  q W| | f S(   s   Split sequence s via predicate, and return pair ([true], [false]).

    The return value is a 2-tuple of lists,
        ([x for x in s if predicate(x)],
         [x for x in s if not predicate(x)])
    (   R   (   t   st	   predicatet   yest   not   x(    (    s   /usr/lib/python2.7/pydoc.pyt   _split_list   s    c         C   s   d } |  | k r d	 S|  j  d
  r8 |  j d
  r8 d S|  j  d  rZ t | d  rZ d S| d k	 rp |  | k S|  j  d  Sd S(   s3   Decide whether to show documentation on a variable.t   __builtins__t   __doc__t   __file__t   __path__R   R   t	   __slots__t   __package__i    t   __i   t   _t   _fieldsN(   RS   RT   RU   RV   R   R   RW   RX   (   t
   startswitht   endswitht   hasattrt   None(   R+   t   allR@   t   _hidden_names(    (    s   /usr/lib/python2.7/pydoc.pyt   visiblename   s       
c         C   s   d   } t  | t j |    S(   sC   Wrap inspect.classify_class_attrs, with fixup for data descriptors.c         S   s:   |  \ } } } } t  j |  r* d } n  | | | | f S(   Ns   data descriptor(   R   t   isdatadescriptor(   t   dataR+   t   kindt   clsRK   (    (    s   /usr/lib/python2.7/pydoc.pyt   fixup   s    	(   t   mapR   t   classify_class_attrs(   R$   Rg   (    (    s   /usr/lib/python2.7/pydoc.pyRi      s    	t   _unicodec           B   s   e  Z RS(    (   R   R   (    (    (    s   /usr/lib/python2.7/pydoc.pyRj      s   t   asciic         C   s   |  S(   N(    (   R4   t   encoding(    (    s   /usr/lib/python2.7/pydoc.pyR!      s    c         C   s-   t  |  t  r% |  j | p t d  S|  Sd  S(   Nt   xmlcharrefreplace(   t
   isinstancet   unicodet   encodet	   _encoding(   R4   Rl   (    (    s   /usr/lib/python2.7/pydoc.pyR!      s    c         C   s)   t  |  t  r |  j t d  St |   S(   NRm   (   Rn   Rj   Rp   Rq   t   str(   R@   (    (    s   /usr/lib/python2.7/pydoc.pyt   _binstr   s    c         C   sS   t  j j |   rO x: d D]/ } t  j j t  j j |  d |   r t Sq Wn  t S(   s3   Guess whether a path refers to a package directory.s   .pys   .pycs   .pyot   __init__(   s   .pys   .pycs   .pyo(   R   R   R   t   isfileR   t   Truet   False(   R   t   ext(    (    s   /usr/lib/python2.7/pydoc.pyt	   ispackage   s
    %c         C   s   |  j    } x7 | d  d k s, t |  rE |  j    } | s Pq q Wt |  } | d  d k ro | d } n  | d  d k r | d } | d d k r | d  } n  x& t |  s |  j    } | s Pq q Wt t | d  d	  } n d  } | S(
   Ni   t   #i   s   r"""i   s   """is   \i    (   t   readlineR   R   R_   (   t   filet   lineR%   (    (    s   /usr/lib/python2.7/pydoc.pyt   source_synopsis   s&       
  c         C   s  t  j |   j } | j |  d  \ } } | d k sB | | k  rt j |   } y t |   } Wn t k
 ru d SX| r d | d k r y  t	 j
 d | |  | d  } Wn d SX| j r | j j   d n d } t j d =n t |  } | j   | | f | |  <n  | S(   s.   Get the one-line summary out of a module file.t   bi   t   __temp__i   i    N(   NN(   R   t   statt   st_mtimet   getR_   R   t   getmoduleinfot   opent   IOErrort   impt   load_moduleRT   t
   splitlinesR   t   modulesR~   t   close(   t   filenamet   cachet   mtimet
   lastupdateR%   t   infoR|   t   module(    (    s   /usr/lib/python2.7/pydoc.pyt   synopsis   s&       "
t   ErrorDuringImportc           B   s    e  Z d  Z d   Z d   Z RS(   sE   Errors that occurred while trying to import something to document it.c         C   s7   | \ } } } | |  _  | |  _ | |  _ | |  _ d  S(   N(   R   t   excRK   t   tb(   R   R   t   exc_infoR   RK   R   (    (    s   /usr/lib/python2.7/pydoc.pyRt     s
    			c         C   sA   |  j  } t |  t j k r* | j } n  d |  j | |  j f S(   Ns   problem in %s - %s: %s(   R   t   typet   typest	   ClassTypeR   R   RK   (   R   R   (    (    s   /usr/lib/python2.7/pydoc.pyt   __str__  s    	(   R   R   RT   Rt   R   (    (    (    s   /usr/lib/python2.7/pydoc.pyR   
  s   	c         C   s   t  j   } t |  d  } | j t |   | k rB t  j } n	 t  j } | j   t j	 j
 |   } t j	 j |  \ } } t |  d  } y% t  j | | |  | d | f  } Wn t |  t j     n X| j   | S(   s<   Import a Python source file or compiled file given its path.t   r(   R   t	   get_magicR   t   readR&   t   PY_COMPILEDt	   PY_SOURCER   R   R   t   basenamet   splitextR   R   R   R   (   R   t   magicR|   Re   R   R+   Rx   R   (    (    s   /usr/lib/python2.7/pydoc.pyt
   importfile  s    	
%
i    c         C   s  y | r |  t  j k r |  t  j k r g  t  j D] } | j |  d  r1 | ^ q1 } x3 |  g | D]! } t  j | | | <t  j | =qd Wq n  t |   } Wn t  j   \ } } }	 }
 |  t  j k r t t  j |  j |
   qJ| t k rt | j	 |
   qJ| t
 k r1t |	  d d d k r1d St |  t  j     n XxC t |  d  d D]. } y t | |  } Wq^t k
 rd SXq^W| S(   s  Import a module; handle errors; return None if the module isn't found.

    If the module *is* found but an exception occurs, it's wrapped in an
    ErrorDuringImport exception and reraised.  Unlike __import__, if a
    package path is specified, the module at the end of the path is returned,
    not the package at the beginning.  If the optional 'forceload' argument
    is 1, we reload the module from disk (unless it's a dynamic extension).R   ii   t
   safeimporti   N(   R   R   t   builtin_module_namesR\   t
   __import__R   R   RU   t   SyntaxErrorR   t   ImportErrorR	   R_   R   RG   t   AttributeError(   R   t	   forceloadR   t   mt   subsRJ   R   R   RK   R   R   t   part(    (    s   /usr/lib/python2.7/pydoc.pyR   ,  s.    /&  	t   Docc           B   si   e  Z d d   Z d d  Z e Z Z Z Z Z	 Z
 e j j e j d d e j d d ! d  Z RS(   c         G   s   | | f | } t  j |  r, |  j |   St  j |  rH |  j |   SyX t  j |  rg |  j |   St  j |  r |  j |   St  j |  r |  j	 |   SWn t
 k
 r n Xt | t  r |  j |   S|  j |   S(   s%   Generate documentation for an object.(   R   t   isgetsetdescriptort   docdatat   ismemberdescriptorR-   t	   docmoduleR.   t   docclassR/   t
   docroutineR   Rn   t   propertyt   docpropertyt   docother(   R   R$   R+   t   args(    (    s   /usr/lib/python2.7/pydoc.pyt   document_  s"          c         G   s6   d | o d t  |  t |  j f } t |  d S(   s+   Raise an exception for unimplemented types.s.   don't know how to document object%s of type %st    N(   t   reprR   R   t	   TypeError(   R   R$   R+   R   t   message(    (    s   /usr/lib/python2.7/pydoc.pyt   failq  s    &t   libt   pythoni    i   c         C   s7  y t  j |  } Wn t k
 r, d } n Xt j j d d  } t j j |  } t | t	 t   r-| j
 d k s | j |  r-| j t j j | d   r-| j t j j | d   r-| j
 d k r-| j d  rd | j d  | j
 j   f } q3t j j | | j
 j   d  } n d } | S(   s*   Return the location of module docs or Nones
   (built-in)t
   PYTHONDOCSs   https://docs.python.org/libraryt   errnot
   exceptionst   gcR   t   marshalt   posixt   signalR   t   threadt	   zipimports   dist-packagess   site-packagess	   xml.etrees   test.pydoc_mods   http://s   https://s   %s/%st   /s   .html(
   R   R   R   R   R   R   R   R   R   R   (   s	   xml.etrees   test.pydoc_mod(   s   http://s   https://N(   R   t
   getabsfileR   R   t   environR   R   R   Rn   R   R   R\   R   R   R   R_   (   R   R$   t   basedirR|   t   docloc(    (    s   /usr/lib/python2.7/pydoc.pyt	   getdoclocy  s(    
	 	%%N(   R   R   R_   R   R   R   R   R   R   R   R   R   R   R   R   t   exec_prefixt   versionR   (    (    (    s   /usr/lib/python2.7/pydoc.pyR   ^  s
   t   HTMLReprc           B   sP   e  Z d  Z d   Z d   Z d   Z d   Z d   Z e Z d   Z	 e Z
 RS(   sB   Class for safely making an HTML representation of a Python object.c         C   s:   t  j |   d |  _ |  _ d |  _ d |  _ |  _ d  S(   Ni   i
   id   (   R    Rt   t   maxlistt   maxtuplet   maxdictt	   maxstringt   maxother(   R   (    (    s   /usr/lib/python2.7/pydoc.pyRt     s    	c         C   s   t  | d d d d d d  S(   Nt   &s   &amp;t   <s   &lt;t   >s   &gt;(   R6   (   R   R4   (    (    s   /usr/lib/python2.7/pydoc.pyt   escape  s    c         C   s   t  j |  |  S(   N(   R    R   (   R   R$   (    (    s   /usr/lib/python2.7/pydoc.pyR     s    c         C   s   t  t |  d  r_ d t t t |  j  d  } t  |  |  r_ t |  |  | |  Sn  |  j t t t	 |   |  j
   S(   NR   t   repr_RZ   (   R^   R   R   R   R   RG   R   R;   R=   R   R   (   R   RQ   t   levelt
   methodname(    (    s   /usr/lib/python2.7/pydoc.pyt   repr1  s
    "c         C   s   t  | |  j  } t |  } d | k rc d t | d d  k rc d | d |  j |  | d St j d d |  j |   S(   Ns   \s   \\R   R   i    s-   ((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)s   <font color="#c040c0">\1</font>(   R;   R   R   R6   R   R"   R#   (   R   RQ   R   t   testt   testrepr(    (    s   /usr/lib/python2.7/pydoc.pyt   repr_string  s    $!	c         C   sK   y) |  j  t t t |   |  j   SWn |  j  d | j j  SXd  S(   Ns   <%s instance>(   R   R;   R=   R   R   t	   __class__R   (   R   RQ   R   (    (    s   /usr/lib/python2.7/pydoc.pyt   repr_instance  s    )(   R   R   RT   Rt   R   R   R   R   t   repr_strR   t   repr_unicode(    (    (    s   /usr/lib/python2.7/pydoc.pyR     s   						t   HTMLDocc           B   sO  e  Z d  Z e   Z e j Z e j Z d   Z d d  Z d d d d d  Z
 d   Z d   Z d	 d
  Z d   Z d   Z d   Z d   Z d   Z d i  i  i  d  Z d d  Z d d d  Z d d i  i  d  Z d   Z d d i  i  i  d d  Z d   Z d d d d  Z d d d  Z d d d d  Z d d  Z RS(   s'   Formatter class for HTML documentation.c         C   s   t  d | | f d  S(   s   Format an HTML page.s   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: %s</title>
<meta charset="utf-8">
</head><body bgcolor="#f0f0f8">
%s
</body></html>Rk   (   R!   (   R   t   titlet   contents(    (    s   /usr/lib/python2.7/pydoc.pyt   page  s    R   c         C   s   d | | | | | p d f S(   s   Format a page heading.s'  
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="%s">
<td valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">&nbsp;<br>%s</font></td
><td align=right valign=bottom
><font color="%s" face="helvetica, arial">%s</font></td></tr></table>
    s   &nbsp;(    (   R   R   t   fgcolt   bgcolt   extras(    (    s   /usr/lib/python2.7/pydoc.pyt   heading  s    	i   s   &nbsp;c	   
      C   sz   | d k r! d d | d } n  d | | | f }	 | rW |	 d | | | | f }	 n |	 d | | | f }	 |	 d | S(	   s    Format a section with a heading.s   <tt>s   &nbsp;s   </tt>s   <p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="%s">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">%s</font></td></tr>
    sR   
<tr bgcolor="%s"><td rowspan=2>%s</td>
<td colspan=2>%s</td></tr>
<tr><td>%s</td>s(   
<tr><td bgcolor="%s">%s</td><td>%s</td>s'   
<td width="100%%">%s</td></tr></table>N(   R_   (
   R   R   R   R   R   t   widtht   preludet
   marginaliat   gapR%   (    (    s   /usr/lib/python2.7/pydoc.pyt   section  s    c         G   s   d | } |  j  | |  S(   s$   Format a section with a big heading.s   <big><strong>%s</strong></big>(   R   (   R   R   R   (    (    s   /usr/lib/python2.7/pydoc.pyt
   bigsection  s    
c      
   C   s7   |  j  t |   } t | d d d d d d d d 	 S(   s!   Format literal preformatted text.s   

s   
 
R   s   &nbsp;s   
s   <br>
(   R   R   R6   (   R   R4   (    (    s   /usr/lib/python2.7/pydoc.pyt	   preformat  s    i   c         C   s   d } t  |  | d | } x t |  D]u } | d d | } xP t | | | | |  D]3 } | t  |  k  r_ | | | |  d } q_ q_ W| d } q+ Wd | S(   s0   Format a list of items into a multi-column list.R   i   s   <td width="%d%%" valign=top>id   s   <br>
s   </td>s7   <table width="100%%" summary="list"><tr>%s</tr></table>(   R&   t   range(   R   t   listt   formatt   colsR%   t   rowst   colt   i(    (    s   /usr/lib/python2.7/pydoc.pyt   multicolumn  s    "c         C   s   d | S(   Ns   <font color="#909090">%s</font>(    (   R   R4   (    (    s   /usr/lib/python2.7/pydoc.pyt   grey  R   c         G   s3   x, | D]$ } | | k r d | | | f Sq W| S(   s:   Make a link for an identifier, given name-to-URL mappings.s   <a href="%s">%s</a>(    (   R   R+   t   dictst   dict(    (    s   /usr/lib/python2.7/pydoc.pyt   namelink  s    c         C   sm   | j  t j j | j  } } t | |  r` t | |  | k r` d | j  | t | |  f St | |  S(   s   Make a link for a class.s   <a href="%s.html#%s">%s</a>(   R   R   R   R   R   R^   RG   R,   (   R   R$   R*   R+   R   (    (    s   /usr/lib/python2.7/pydoc.pyt	   classlink  s
    $c         C   s   d | j  | j  f S(   s   Make a link for a module.s   <a href="%s.html">%s</a>(   R   (   R   R$   (    (    s   /usr/lib/python2.7/pydoc.pyt
   modulelink  s    c         C   so   | \ } } } } | r% |  j  |  S| r> d | | f } n
 d | } | r[ d | } n | } d | | f S(   s;   Make a link for a module or package to display in an index.s
   %s.%s.htmls   %s.htmls"   <strong>%s</strong>&nbsp;(package)s   <a href="%s">%s</a>(   R   (   R   Rd   R+   R   Ry   t   shadowedt   urlR4   (    (    s   /usr/lib/python2.7/pydoc.pyt
   modpkglink"  s    
c         C   s  | p |  j  } g  } d } t j d  } xt r| j | |  }	 |	 sO Pn  |	 j   \ }
 } | j | | | |
 !  |	 j   \ } } } } } } | r | |  j d d  } | j d | | f  n| rd t	 |  } | j d | | |  f  n | r=d t	 |  } | j d | | |  f  n | r| | | d !d	 k rz| j d
 |  j
 | |   q| j d |  nR | | | d !d	 k r| j |  j
 | | | |   n | j |  j
 | |   | } q- W| j | | |   t | d  S(   s   Mark up some plain text, given a context of symbols to look for.
        Each context dictionary maps object names to anchor names.i    sD   \b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?(\w+))t   "s   &quot;s   <a href="%s">%s</a>s'   http://www.rfc-editor.org/rfc/rfc%d.txts(   http://www.python.org/dev/peps/pep-%04d/i   t   (s   self.s   self.<strong>%s</strong>R   (   R   R"   t   compileRv   t   searcht   spanR   t   groupsR6   t   intR  R   (   R   R4   R   t   funcst   classesRI   t   resultst   heret   patternt   matcht   startt   endR`   t   schemet   rfct   pept   selfdotR+   R  (    (    s   /usr/lib/python2.7/pydoc.pyt   markup1  s<    	    "
c   
      C   s  d } x | D] } t  |  t  d	  k r | \ } } | d } | |  j | |  } | r | | f k r g  } x' | D] }	 | j |  j |	 |   qy W| d t | d  d } n  | d } q t  |  t  g   k r | d |  j | | |  } q q Wd | S(
   sA   Produce HTML for a class tree as given by inspect.getclasstree().R   s"   <dt><font face="helvetica, arial">R  s   , t   )s   
</font></dt>s   <dd>
%s</dd>
s   <dl>
%s</dl>
(    (   R   R  R   R   t
   formattree(
   R   t   treeR*   t   parentR%   t   entryt   ct   basest   parentsRL   (    (    s   /usr/lib/python2.7/pydoc.pyR  \  s     
c   $      G   s  | j  } y | j } Wn t k
 r/ d } n Xt | d  } g  } xJ t t |  d  D]2 } | j d t | | d  d  | | f  q\ Wt | | d d  }	 d |	 }
 yV t	 j
 |  } | } t j d k r d d l } | j |  } n  d | | f } Wn t k
 r"d	 } n Xg  } t | d
  rt | j  } | d  d. k r}| d d k r}t | d d ! } n  | j d |  j |   n  t | d  r| j |  j t | j    n  | r|
 d t | d  }
 n  |  j |  } | d k	 rd t   } n d } |  j |
 d d d | |  } t	 j | t	 j  } g  i  } } x t	 j | t	 j  D]t \ } } | d k	 st	 j |  p| | k rtt | | |  r| j | | f  d | | | <| | <qqtqtWx | D] \ } } x | j D] } | j  | j } } t j  j! |  } | | k r	| r	t | |  r	t" | |  | k r| | k r| d | | | <| | <qqq	q	WqWg  i  } } x t	 j | t	 j#  D] \ } } | d k	 s t	 j$ |  s t	 j |  | k rt | | |  rY| j | | f  d | | | <t	 j% |  rV| | | | <qVqYqqWg  } xH t	 j | t&  D]4 \ } } t | | |  rv| j | | f  qvqvW|  j' t( |  |  j) | |  } | od | } | d | } t | d  rg  } x< t* j+ | j,  D]( \ }  } }! | j | | |! d f  qW| j-   |  j. | |  j/  }" | |  j0 d d d |"  } n= | r|  j. | |  d    }" | |  j0 d! d d |"  } n  | rSt1 d"   |  }# |  j2 t	 j3 |# d  |  g }" x6 | D]. \ } } |" j |  j4 | | | | |   qW| |  j0 d# d d$ t |"   } n  | rg  }" x6 | D]. \ } } |" j |  j4 | | | | |   qfW| |  j0 d% d d& t |"   } n  | r!g  }" x- | D]% \ } } |" j |  j4 | |   qW| |  j0 d' d d( t |" d)   } n  t | d*  rm|  j' t | j5  |  j)  }" | |  j0 d+ d d |"  } n  t | d,  r|  j' t | j6  |  j)  }" | |  j0 d- d d |"  } n  | S(/   s/   Produce HTML documentation for a module object.R   i   s5   <a href="%s.html"><font color="#ffffff">%s</font></a>is)   <big><big><strong>%s</strong></big></big>t   win32Ns   <a href="file:%s">%s</a>s
   (built-in)t   __version__i   t   $s
   Revision: s
   version %st   __date__s    (%s)s   , s(   <br><a href="%(docloc)s">Module Docs</a>R   s   #ffffffs   #7799ees   <a href=".">index</a><br>Rz   s   .html#s   #-s   <tt>%s</tt>s
   <p>%s</p>
RV   i    s   Package Contentss   #aa55ccc         S   s   | j  |  d  S(   Ni   (   R  (   t	   key_valueRM   (    (    s   /usr/lib/python2.7/pydoc.pyt   <lambda>  R   t   Modulesc         S   s   |  d S(   Ni   (    (   R'  (    (    s   /usr/lib/python2.7/pydoc.pyR(    R   t   Classess   #ee77aat	   Functionss   #eeaa77t   Datas   #55aa55s   <br>
t
   __author__t   Authort   __credits__t   Creditss   $Revision: (7   R   t   __all__R   R_   R   R   R&   R   R   R   R   R   t   platformt
   nturl2patht   pathname2urlR   R^   Rs   R$  R   R   R&  R   t   localsR   RB   R-   R.   t	   getmoduleRb   RC   R   R   R   RG   R/   t	   isbuiltint
   isfunctionR3   R  R   R   t   pkgutilt   iter_modulesRV   t   sortR   R  R   Rh   R  t   getclasstreeR   R-  R/  ($   R   R$   R+   t   modt   ignoredR`   t   partst   linksR   t
   linkednamet   headR   R  R3  t   filelinkR   R   R   R%   R   R  t   cdictRJ   RK   RL   R*   R   R  t   fdictRd   R'   t   modpkgst   importert   ispkgR   t	   classlist(    (    s   /usr/lib/python2.7/pydoc.pyR   o  s    	
'

 "	" !+"$ !"
		!&	&				c            s   j  } | p | }  j } g  }	 |	 j  d d(  f d     Y}
 |
    t t j    } t |  d k r  j    d  x+ | D]# }  d  j |  j	   q W d  n           f d   }     f d   }          f d	   } t
  f d
   t    } i   x} | D]u \ } } } } d | d |  | <} y t  |  } Wn t k
 rn Xy |  | <WqPt k
 rqPXqPWxn| r9| r| j    n | d d  t |  f d    \ } }  t j k r.| } qn.   k rCd } n d  j   j	  } | d 7} y | j d d    Wn! t k
 r| j d    n X| d | | d    } | d | | d    } | d | | d    } | d | | d    } | d | | d    } | g  k s0t  | } qWd j |	  }	 | | k rhd  | | f } n d! | | | f } | rg  } x* | D]" } | j  j |  j	   qW| d" t | d#  } n   j t    j      } | od$ | }  j | d% d& |	 d' |  S()   s.   Produce HTML documentation for a class object.t   HorizontalRulec              s    e  Z d    Z   f d   Z RS(   c         S   s   d |  _  d  S(   Ni    (   t   needone(   R   (    (    s   /usr/lib/python2.7/pydoc.pyRt     s    c            s#   |  j  r   d  n  d |  _  d  S(   Ns   <hr>
i   (   RK  (   R   (   t   push(    s   /usr/lib/python2.7/pydoc.pyt   maybe  s    	(   R   R   Rt   RM  (    (   RL  (    s   /usr/lib/python2.7/pydoc.pyRJ    s   	i   s&   <dl><dt>Method resolution order:</dt>
s   <dd>%s</dd>
s   </dl>
c      
      s   t  | |  \ } } | r  j    |   x | D] \ } } } } y t  |  } Wn* t k
 r   j | |    n& X  j | |          d  q6 Wn  | S(   Ns   
(   RR   RM  RG   t	   Exceptiont   _docdescriptorR   (   t   msgt   attrsRN   t   okR+   Re   t   homeclsRK   (   R  R  t   hrt   mdictR=  R$   RL  R   (    s   /usr/lib/python2.7/pydoc.pyt   spill	  s    

c            sl   t  | |  \ } } | rh   j    |   x6 | D]+ \ } } } }   j | |    q6 Wn  | S(   N(   RR   RM  RO  (   RP  RQ  RN   RR  R+   Re   RS  RK   (   RT  R=  RL  R   (    s   /usr/lib/python2.7/pydoc.pyt   spilldescriptors  s    

 c   
         s  t  | |  \ } } | r j    |   x | D] \ } } } }  j t  |  |   } t | d  s t j |  r t | d d   }	 n d  }	 |	 d  k r  d |  nB  j t	 |   j
      }	 d |	 }	  d | |	 f   d  q6 Wn  | S(   Nt   __call__RT   s   <dl><dt>%s</dl>
s   <dd><tt>%s</tt>s   <dl><dt>%s%s</dl>
s   
(   RR   RM  R   RG   R^   R   Rc   R_   R  R   R   (
   RP  RQ  RN   RR  R+   Re   RS  RK   RL   R'   (   R  R  RT  RU  R=  R$   RL  R   (    s   /usr/lib/python2.7/pydoc.pyt	   spilldata$  s$    


c            s   t  |  d d   S(   Ni    R@   (   Rb   (   Rd   (   R$   (    s   /usr/lib/python2.7/pydoc.pyR(  :  R   Rz   t   -i    c            s   |  d   k S(   Ni   (    (   t   t(   t	   thisclass(    s   /usr/lib/python2.7/pydoc.pyR(  Q  R   s   defined heres   inherited from %ss   :<br>
RJ   c         S   s   |  d S(   Ni    (    (   R[  (    (    s   /usr/lib/python2.7/pydoc.pyR(  _  R   c         S   s   t  |  d | d  S(   Ni    (   t   cmp(   t   t1t   t2(    (    s   /usr/lib/python2.7/pydoc.pyR(  a  R   s
   Methods %sc         S   s   |  d d k S(   Ni   t   method(    (   R[  (    (    s   /usr/lib/python2.7/pydoc.pyR(  e  R   s   Class methods %sc         S   s   |  d d k S(   Ni   s   class method(    (   R[  (    (    s   /usr/lib/python2.7/pydoc.pyR(  g  R   s   Static methods %sc         S   s   |  d d k S(   Ni   s   static method(    (   R[  (    (    s   /usr/lib/python2.7/pydoc.pyR(  i  R   s   Data descriptors %sc         S   s   |  d d k S(   Ni   s   data descriptor(    (   R[  (    (    s   /usr/lib/python2.7/pydoc.pyR(  k  R   s   Data and other attributes %sc         S   s   |  d d k S(   Ni   Rd   (    (   R[  (    (    s   /usr/lib/python2.7/pydoc.pyR(  m  R   R   s*   <a name="%s">class <strong>%s</strong></a>s/   <strong>%s</strong> = <a name="%s">class %s</a>s   (%s)s   , s   <tt>%s<br>&nbsp;</tt>s   #000000s   #ffc8d8i   (    (   R   RC   R   R
   R   t   getmroR&   RM  R  R   t   filterRi   RG   RN  R   R   RR   t   __builtin__R$   R;  t   AssertionErrorR   R  R   R   R   (   R   R$   R+   R=  R  R  R>  t   realnameR!  R   RJ  t   mroRL   RV  RW  RY  RQ  RJ   Re   RS  RK   t   anchort	   inheritedt   tagR   R"  R'   (    (	   R  R  RT  RU  R=  R$   RL  R   R\  s   /usr/lib/python2.7/pydoc.pyR     s    				

$	$		

 $c         C   s   |  j  d |  j |   S(   s)   Format an argument default value as text.t   =(   R   R   (   R   R$   (    (    s   /usr/lib/python2.7/pydoc.pyt   formatvalue  s    c         C   sG  | j  } | p | } | r$ | j  p' d d | }	 d }
 d } t j |  r | j } | r | | k	 r d |  j | |  }
 q nD | j d k	 r d |  j | j j |  }
 n d |  j | |  }
 | j } n  | | k r d |	 | f } ne | r?| | j	 k r?| j	 | | k r?d | j  d | | f } d	 } n | } d
 |	 | | f } t j
 |  rt j |  \ } } } } t j | | | | d |  j } | d k rd | } | d	 d !} qn d } | | |
 o|  j d |
  } | rd | S|  j t |  |  j | | |  } | o2d | } d | | f Sd S(   s;   Produce HTML documentation for a function or method object.R   RZ  i    s    from s    method of %s instances    unbound %s methods$   <a name="%s"><strong>%s</strong></a>s   <a href="#%s">%s</a>i   s)   <a name="%s"><strong>%s</strong></a> = %sRk  s   <lambda>s$   <strong>%s</strong> <em>lambda</em> is   (...)s'   <font face="helvetica, arial">%s</font>s   <dl><dt>%s</dt></dl>
s   <dd><tt>%s</tt></dd>s   <dl><dt>%s</dt>%s</dl>
N(   R   R   R>   t   im_classR  t   im_selfR_   R   t   im_funct   __dict__R8  t
   getargspect   formatargspecRk  R   R  R   R   (   R   R$   R+   R=  R  R  RI   RH   Re  Rg  t   notet   skipdocst   imclassR   t   reallinkR   t   varargst   varkwt   defaultst   argspect   declR'   (    (    s   /usr/lib/python2.7/pydoc.pyR     sR    				
c         C   sx   g  } | j  } | r& | d |  n  | j d  k	 ra |  j t |  |  j  } | d |  n  | d  d j |  S(   Ns!   <dl><dt><strong>%s</strong></dt>
s   <dd><tt>%s</tt></dd>
s   </dl>
R   (   R   RT   R_   R  R   R   R   (   R   R+   RK   R=  R  RL  R'   (    (    s   /usr/lib/python2.7/pydoc.pyRO    s    	
c         C   s   |  j  | | |  S(   s*   Produce html documentation for a property.(   RO  (   R   R$   R+   R=  RH   (    (    s   /usr/lib/python2.7/pydoc.pyR     s    c         G   s'   | r d | p d } | |  j  |  S(   s-   Produce HTML documentation for a data object.s   <strong>%s</strong> = R   (   R   (   R   R$   R+   R=  R>  t   lhs(    (    s   /usr/lib/python2.7/pydoc.pyR     s    c         C   s   |  j  | | |  S(   s1   Produce html documentation for a data descriptor.(   RO  (   R   R$   R+   R=  RH   (    (    s   /usr/lib/python2.7/pydoc.pyR     s    c         C   s   g  } | d k r i  } n  xL t j | g  D]8 \ } } } | j | d | | | k f  d | | <q. W| j   |  j | |  j  } |  j | d d |  S(   s2   Generate an HTML index for a directory of modules.R   i   s   #ffffffs   #ee77aaN(   R_   R9  R:  R   R;  R   R  R   (   R   R   R  RF  RG  R+   RH  R   (    (    s   /usr/lib/python2.7/pydoc.pyt   index  s     	"
N(   R   R   RT   R   t   _repr_instanceR   R   R   R   R_   R   R   R   R   R   R  R  R  R  R  R  R   R   Rk  R   RO  R   R   R   R|  (    (    (    s   /usr/lib/python2.7/pydoc.pyR     s8   				
							+|	5	t   TextReprc           B   s8   e  Z d  Z d   Z d   Z d   Z e Z d   Z RS(   sA   Class for safely making a text representation of a Python object.c         C   s:   t  j |   d |  _ |  _ d |  _ d |  _ |  _ d  S(   Ni   i
   id   (   R    Rt   R   R   R   R   R   (   R   (    (    s   /usr/lib/python2.7/pydoc.pyRt     s    	c         C   s{   t  t |  d  r_ d t t t |  j  d  } t  |  |  r_ t |  |  | |  Sn  t t t |   |  j	  S(   NR   R   RZ   (
   R^   R   R   R   R   RG   R;   R=   R   R   (   R   RQ   R   R   (    (    s   /usr/lib/python2.7/pydoc.pyR     s
    "c         C   s^   t  | |  j  } t |  } d | k rZ d t | d d  k rZ d | d | | d S| S(   Ns   \s   \\R   R   i    (   R;   R   R   R6   (   R   RQ   R   R   R   (    (    s   /usr/lib/python2.7/pydoc.pyR     s
    $c         C   s9   y  t  t t |   |  j  SWn d | j j SXd  S(   Ns   <%s instance>(   R;   R=   R   R   R   R   (   R   RQ   R   (    (    s   /usr/lib/python2.7/pydoc.pyR     s     (   R   R   RT   Rt   R   R   R   R   (    (    (    s   /usr/lib/python2.7/pydoc.pyR~    s   				t   TextDocc           B   s   e  Z d  Z e   Z e j Z d   Z d d  Z d   Z d d d  Z
 d d d  Z d d d  Z d	   Z d d d d
  Z d   Z d d d d  Z d d d d  Z d d d d d d  Z RS(   s'   Formatter class for text documentation.c         C   s   t  t d   |  d  S(   s(   Format a string in bold by overstriking.c         S   s   |  d |  S(   Ns   (    (   t   ch(    (    s   /usr/lib/python2.7/pydoc.pyR(    R   R   (   R   Rh   (   R   R4   (    (    s   /usr/lib/python2.7/pydoc.pyt   bold  s    s       c         C   sX   | s
 d St  | d  } t | d  |  } | rK t | d  | d <n  t | d  S(   s6   Indent text by prepending a given prefix to each line.R   s   
c         S   s   | |  S(   N(    (   R}   t   prefix(    (    s   /usr/lib/python2.7/pydoc.pyR(    R   i(   R   Rh   R   R   (   R   R4   R  R(   (    (    s   /usr/lib/python2.7/pydoc.pyt   indent  s      c         C   s(   |  j  |  d t |  j |   d S(   s&   Format a section with a given heading.s   
s   

(   R  R   R  (   R   R   R   (    (    s   /usr/lib/python2.7/pydoc.pyR     s    R   c   
      C   s   d } x | D] } t  |  t  d  k r | \ } } | | t | |  } | r | | f k r t | d  |  }	 | d t |	 d  } n  | d } q t  |  t  g   k r | |  j | | | | d  } q q W| S(   sB   Render in text a class tree as returned by inspect.getclasstree().R   c         S   s   t  |  |  S(   N(   R,   (   R   R   (    (    s   /usr/lib/python2.7/pydoc.pyR(  '  R   s   (%s)s   , s   
s       (    (   R   R,   Rh   R   R  (
   R   R  R*   R  R  R%   R  R   R!  R"  (    (    s   /usr/lib/python2.7/pydoc.pyR    s    	c         C   s  | j  } t t |   \ } } |  j d | | o: d |  } y | j } Wn t k
 rg d  } n Xy t j |  } Wn t	 k
 r d } n X| |  j d |  } |  j
 |  }	 |	 d  k	 r | |  j d |	  } n  | r | |  j d |  } n  g  }
 xu t j | t j  D]^ \ } } | d  k	 sMt j |  pD| | k rt | | |  rx|
 j | | f  qxqqWg  } x~ t j | t j  D]g \ } } | d  k	 st j |  st j |  | k rt | | |  r| j | | f  qqqWg  } xH t j | t  D]4 \ } } t | | |  r| j | | f  qqWg  } t   } t | d  rxW t j | j  D]C \ } } } | j |  | r| j | d  q| j |  qW| j   | |  j d	 t | d
   } n  g  } xU t j | t j  D]> \ } } | j  j | d  r| | k r| j |  qqW| r| j   | |  j d t | d
   } n  |
 rt d   |
  } |  j t j | d  |  g } x0 |
 D]( \ } } | j |  j  | | |   qW| |  j d t | d
   } n  | rwg  } x0 | D]( \ } } | j |  j  | | |   q)W| |  j d t | d
   } n  | rg  } x6 | D]. \ } } | j |  j! | | | d d  qW| |  j d t | d
   } n  t | d  rKt" | j#  } | d  d! k r2| d d k r2t$ | d d ! } n  | |  j d |  } n  t | d  r|| |  j d t" | j%   } n  t | d  r| |  j d t" | j&   } n  t | d  r| |  j d t" | j'   } n  | S("   s5   Produce text documentation for a given module object.t   NAMEs    - s
   (built-in)t   FILEs   MODULE DOCSt   DESCRIPTIONRV   s
    (package)s   PACKAGE CONTENTSs   
R   t
   SUBMODULESc         S   s   |  d S(   Ni   (    (   R'  (    (    s   /usr/lib/python2.7/pydoc.pyR(  s  R   i   t   CLASSESt	   FUNCTIONSR8   iF   t   DATAR$  i   R%  s
   Revision: it   VERSIONR&  t   DATER-  t   AUTHORR/  t   CREDITSNs   $Revision: ((   R   R)   R   R   R1  R   R_   R   R   R   R   RB   R.   R6  Rb   R   R/   R7  R3   t   setR^   R9  R:  RV   t   addR;  R   R-   R\   Rh   R  R<  R   R   Rs   R$  R   R&  R-  R/  (   R   R$   R+   R=  t   synopt   descR%   R`   R|   R   R  RJ   RK   R  Rd   RF  t   modpkgs_namesRG  R*   RH  t
   submodulesRI  R   R   (    (    s   /usr/lib/python2.7/pydoc.pyR   /  s    	 

""$	"
	""
	 " "&" """c            s&   j  } | p | }  j }  j d  } | | k rO d  j |  } n  j |  d | } | r t | |  }	 | d t |	 d  } n  t   }
 |
 r |
 d g p g  } | j  t t	 j
    } t |  d k r& d  x" | D] }  d	 | |   q W d
  n  d d   f d     Y} |           f d   }      f d   }       f d   } t  f d   t    } x0| r| r| j    n | d d  t |  f d    \ } }  t j k r| } qn+   k r.d } n d t   j  } | j   | d | | d    } | d | | d    } | d | | d    } | d | | d    } | d | | d    } | g  k st  | } qWd j |  } | s| d S| d  j t |  d  d S(!   s4   Produce text documentation for a given class object.c         S   s   t  |  |  S(   N(   R,   (   R   R   (    (    s   /usr/lib/python2.7/pydoc.pyt   makename  s    s   class s	    = class s   (%s)s   , s   
i   s   Method resolution order:s       R   RJ  c              s    e  Z d    Z   f d   Z RS(   c         S   s   d |  _  d  S(   Ni    (   RK  (   R   (    (    s   /usr/lib/python2.7/pydoc.pyRt     s    c            s'   |  j  r   d d  n  d |  _  d  S(   NRZ  iF   i   (   RK  (   R   (   RL  (    s   /usr/lib/python2.7/pydoc.pyRM    s    	(   R   R   Rt   RM  (    (   RL  (    s   /usr/lib/python2.7/pydoc.pyRJ    s   	c            s   t  | |  \ } } | r   j    |   xy | D]n \ } } } } y t  |  } Wn* t k
 r   j | |    q6 X  j | |     q6 Wn  | S(   N(   RR   RM  RG   RN  RO  R   (   RP  RQ  RN   RR  R+   Re   RS  RK   (   RT  R=  R$   RL  R   (    s   /usr/lib/python2.7/pydoc.pyRV    s    

c            sl   t  | |  \ } } | rh   j    |   x6 | D]+ \ } } } }   j | |    q6 Wn  | S(   N(   RR   RM  RO  (   RP  RQ  RN   RR  R+   Re   RS  RK   (   RT  R=  RL  R   (    s   /usr/lib/python2.7/pydoc.pyRW    s    

 c   	   
      s   t  | |  \ } } | r   j    |   x | D]w \ } } } } t | d  sf t j |  ru t |  } n d  }   j t  |  |  d d d | d  q6 Wn  | S(   NRX  R8   iF   R'   s   
(	   RR   RM  R^   R   Rc   R   R_   R   RG   (	   RP  RQ  RN   RR  R+   Re   RS  RK   R'   (   RT  R=  R$   RL  R   (    s   /usr/lib/python2.7/pydoc.pyRY    s    

$c            s   t  |  d d   S(   Ni    R@   (   Rb   (   Rd   (   R$   (    s   /usr/lib/python2.7/pydoc.pyR(    R   i    c            s   |  d   k S(   Ni   (    (   R[  (   R\  (    s   /usr/lib/python2.7/pydoc.pyR(    R   s   defined heres   inherited from %ss   Methods %s:
c         S   s   |  d d k S(   Ni   R`  (    (   R[  (    (    s   /usr/lib/python2.7/pydoc.pyR(    R   s   Class methods %s:
c         S   s   |  d d k S(   Ni   s   class method(    (   R[  (    (    s   /usr/lib/python2.7/pydoc.pyR(    R   s   Static methods %s:
c         S   s   |  d d k S(   Ni   s   static method(    (   R[  (    (    s   /usr/lib/python2.7/pydoc.pyR(    R   s   Data descriptors %s:
c         S   s   |  d d k S(   Ni   s   data descriptor(    (   R[  (    (    s   /usr/lib/python2.7/pydoc.pyR(     R   s   Data and other attributes %s:
c         S   s   |  d d k S(   Ni   Rd   (    (   R[  (    (    s   /usr/lib/python2.7/pydoc.pyR(    R   s    |  (    (   R   RC   R   R  Rh   R   R   R   R
   R   Ra  R&   Rb  Ri   R   RR   Rc  R$   R,   R;  Rd  R  R   (   R   R$   R+   R=  R>  Re  R!  R  R   R"  R'   R   Rf  RL   RJ  RV  RW  RY  RQ  Rh  Ri  (    (   RT  R=  R$   RL  R   R\  s   /usr/lib/python2.7/pydoc.pyR     sn    			
					

c         C   s   d |  j  |  S(   s)   Format an argument default value as text.Rj  (   R   (   R   R$   (    (    s   /usr/lib/python2.7/pydoc.pyRk    s    c         C   s  | j  } | p | } d } d } t j |  r | j } | rd | | k	 r d t | |  } q n> | j d k	 r d t | j j |  } n d t | |  } | j } n  | | k r |  j	 |  }	 nH | r | | j
 k r | j
 | | k r d } n  |  j	 |  d | }	 t j |  rt j |  \ }
 } } } t j |
 | | | d |  j } | d	 k r|  j	 |  d
 }	 | d d !} qn d } |	 | | } | r| d St |  pd } | d | ot |  j |   d Sd S(   s;   Produce text documentation for a function or method object.R   i    s    from s    method of %s instances    unbound %s methodi   s    = Rk  s   <lambda>s    lambda is   (...)s   
N(   R   R   R>   Rl  R,   Rm  R_   R   Rn  R  Ro  R8  Rp  Rq  Rk  R   R   R  (   R   R$   R+   R=  RH   Re  Rr  Rs  Rt  R   R   Rv  Rw  Rx  Ry  Rz  R'   (    (    s   /usr/lib/python2.7/pydoc.pyR     sB    			c         C   sz   g  } | j  } | r5 | |  j |   | d  n  t |  pD d } | rm | |  j |   | d  n  d j |  S(   Ns   
R   (   R   R  R   R  R   (   R   R+   RK   R=  R  RL  R'   (    (    s   /usr/lib/python2.7/pydoc.pyRO  :  s    	c         C   s   |  j  | | |  S(   s*   Produce text documentation for a property.(   RO  (   R   R$   R+   R=  RH   (    (    s   /usr/lib/python2.7/pydoc.pyR   G  s    c         C   s   |  j  | | |  S(   s1   Produce text documentation for a data descriptor.(   RO  (   R   R$   R+   R=  RH   (    (    s   /usr/lib/python2.7/pydoc.pyR   K  s    c   
      C   s   |  j  |  } | r_ | r% | d p( d | } | t |  }	 |	 d k  r_ | |	  d } q_ n  | rx |  j |  d p{ d | } | d k	 r | d |  j t |   7} n  | S(   s-   Produce text documentation for a data object.s    = R   i    s   ...s   
N(   R   R&   R  R_   R  Rr   (
   R   R$   R+   R=  R  R8   R'   R   R}   t   chop(    (    s   /usr/lib/python2.7/pydoc.pyR   O  s     # N(   R   R   RT   R~  R}  R   R  R  R   R_   R  R   R   Rk  R   RO  R   R   R   (    (    (    s   /usr/lib/python2.7/pydoc.pyR    s   				dx	+	c         C   s   t    a t |   d S(   sC   The first time this is called, determine what kind of pager to use.N(   t   getpagert   pager(   R4   (    (    s   /usr/lib/python2.7/pydoc.pyR  ]  s    	c          C   s  t  t j  t j k	 r t St t j d  s2 t St j j   sR t j j   rV t Sd t	 j
 k r t j d k r{ d   St	 j
 j d  d k r d   Sd	   Sn  t	 j
 j d  d k r t St j d k s t j j d
  r d   St t	 d  rt	 j d  d k rd   St t	 d  r>t	 j d  d k r>d   Sd d l }  |  j   \ } } t	 j |  z7 t t	 d  rt	 j d |  d k rd   St SWd t	 j |  Xd S(   s2   Decide what method to use for paging through text.t   isattyt   PAGERR#  c         S   s   t  t |   t j d  S(   NR  (   t   tempfilepagert   plainR   R   (   R4   (    (    s   /usr/lib/python2.7/pydoc.pyR(  m  R   t   TERMt   dumbt   emacsc         S   s   t  t |   t j d  S(   NR  (   t	   pipepagerR  R   R   (   R4   (    (    s   /usr/lib/python2.7/pydoc.pyR(  o  R   c         S   s   t  |  t j d  S(   NR  (   R  R   R   (   R4   (    (    s   /usr/lib/python2.7/pydoc.pyR(  q  R   t   os2c         S   s   t  t |   d  S(   Ns   more <(   R  R  (   R4   (    (    s   /usr/lib/python2.7/pydoc.pyR(  u  R   t   systems   (pager) 2>/dev/nulli    c         S   s   t  |  d  S(   NR  (   R  (   R4   (    (    s   /usr/lib/python2.7/pydoc.pyR(  w  R   s   (less) 2>/dev/nullc         S   s   t  |  d  S(   Nt   less(   R  (   R4   (    (    s   /usr/lib/python2.7/pydoc.pyR(  y  R   iNs	   more "%s"c         S   s   t  |  d  S(   Nt   more(   R  (   R4   (    (    s   /usr/lib/python2.7/pydoc.pyR(    R   (   R  R  (   R  R  (   R   R   t   stdoutR   t   FileTypet
   plainpagerR^   t   stdinR  R   R   R2  R   R\   R  t   tempfilet   mkstempR   t   ttypagert   unlink(   R  t   fdR   (    (    s   /usr/lib/python2.7/pydoc.pyR  c  s8     
!$$(c         C   s   t  j d d |   S(   s%   Remove boldface formatting from text.s   .R   (   R"   R#   (   R4   (    (    s   /usr/lib/python2.7/pydoc.pyR    s    c         C   sK   t  j | d  } y! | j t |    | j   Wn t k
 rF n Xd S(   s3   Page through text by feeding it to another program.t   wN(   R   t   popent   writeR!   R   R   (   R4   t   cmdt   pipe(    (    s   /usr/lib/python2.7/pydoc.pyR    s    c         C   sv   d d l  } | j   } t | d  } | j t |    | j   z t j | d | d  Wd t j |  Xd S(   s<   Page through text by invoking a program on a temporary file.iNR  s    "R  (	   R  t   mktempR   R  R!   R   R   R  R  (   R4   R  R  R   R|   (    (    s   /usr/lib/python2.7/pydoc.pyR    s    
c   
      C   s?  t  t t  |   t t j d t    j d  } yD d d l } t j j	   } | j
 |  } | j |  d   } Wn& t t f k
 r d } d   } n Xzxy t t j j d d   } Wn t k
 r d } n X| d	 k r d
 } n  | d	 } } t j j t | |  d  d  x | | rt j j d  t j j   |   }	 |	 d k rst j j d  Pn8 |	 d k rt j j d | | d  | d	 } q#n  |	 d k r| | | } | d k  rd } qn  t j j d t | | | | !d  d  | | } q#WWd | r:| j | | j |  n  Xd S(   s%   Page through text on a text terminal.Rl   s   
iNc           S   s   t  j j d  S(   Ni   (   R   R  R   (    (    (    s   /usr/lib/python2.7/pydoc.pyR(    R   c           S   s   t  j j   d  d  S(   Nii   (   R   R  R{   (    (    (    s   /usr/lib/python2.7/pydoc.pyR(    R   t   LINESi    i   i   s
   -- more --t   qt   Qs             s   R   t   Bs   (   R  R  (   s   s   
(   R   R  s   (   R  R!   RG   R   R  Rq   R   t   ttyR  t   filenot	   tcgetattrt	   setcbreakR   R   R_   R  R   R   R   t
   ValueErrorR  R   t   flusht	   tcsetattrt	   TCSAFLUSH(
   R4   R(   R  R  t   oldt   getchart   hR   t   incR   (    (    s   /usr/lib/python2.7/pydoc.pyR    sL    3
	!	
 ,c         C   s2   t  j j t t |   t t  j d t    d S(   s>   Simply print unformatted text.  This is the ultimate fallback.Rl   N(   R   R  R  R!   R  RG   Rq   (   R4   (    (    s   /usr/lib/python2.7/pydoc.pyR    s    c         C   sJ  t  j |   rT |  j t j k r, d |  j St |  d  rF d |  j Sd |  j Sn  t  j |   rn d |  j St  j |   r d |  j j	 |  j j |  j f St  j
 |   r d |  j j	 |  j j |  j f St  j |   r d |  j St  j |   r d	 |  j St  j |   rd
 |  j St |   t j k r=d |  j j St |   j S(   s/   Produce a short description of the given thing.s   built-in module RV   s   package s   module s   built-in function s   getset descriptor %s.%s.%ss   member descriptor %s.%s.%ss   class s	   function s   method s   instance of (   R   R-   R   R   R   R^   R7  R   t   __objclass__R   R   R.   R8  R>   R   R   t   InstanceTypeR   (   t   thing(    (    s   /usr/lib/python2.7/pydoc.pyt   describe  s2    c         C   s   g  t  |  d  D] } | r | ^ q } d \ } } xQ | t |  k  r t t | | d  d  |  } | r | | d } } q7 Pq7 W| r | } n t } x: | | D]. } y t | |  } Wq t k
 r d SXq W| S(   s@   Locate an object by name or dotted path, importing as necessary.R   i    i   N(   Ni    (   R   R_   R&   R   R   Rc  RG   R   (   R   R   R   R?  R   t   nt
   nextmoduleR$   (    (    s   /usr/lib/python2.7/pydoc.pyt   locate  s     (  		t   _OldStyleClassc           B   s   e  Z RS(    (   R   R   (    (    (    s   /usr/lib/python2.7/pydoc.pyR    s    c         C   sy   t  |  t  rD t |  |  } | d k r: t d |   n  | |  f St |  d d  } |  t  | t  rn | n d f Sd S(   sD   Given an object or a path to an object, get the object and its name.s$   no Python documentation found for %rR   N(   Rn   Rr   R  R_   R   RG   (   R  R   R$   R+   (    (    s   /usr/lib/python2.7/pydoc.pyt   resolve  s    
s    Python Library Documentation: %sc         C   s3  t  |  |  \ } } t |  } t j |  } | r` d | k r` | d | | j d   7} n& | r | | k	 r | d | j 7} n  t |  t k r | j } ns t j	 |  p t j
 |  p t j |  p t j |  p t j |  p t | t  st |  } | d 7} n  | | d t j | |  S(   sB   Render text documentation, given an object or a path to an object.R   s    in s    in module s    objects   

(   R  R  R   R6  R   R   R   t   _OLD_INSTANCE_TYPER   R-   R.   R/   R   R   Rn   R   R4   R   (   R  R   R   R$   R+   R  R   (    (    s   /usr/lib/python2.7/pydoc.pyt
   render_doc  s$    c         C   s?   y t  t |  | |   Wn t t f k
 r: } | GHn Xd S(   sC   Display text documentation, given an object or a path to an object.N(   R  R  R   R   (   R  R   R   RK   (    (    s   /usr/lib/python2.7/pydoc.pyR'   +  s    c         C   s   yt t  |  |  \ } } t j t |  t j | |   } t | d d  } | j |  | j   d G| d GHWn t t	 f k
 r } | GHn Xd S(   s<   Write HTML documentation to a file in the current directory.s   .htmlR  t   wroteN(
   R  t   htmlR   R  R   R   R  R   R   R   (   R  R   R$   R+   R   R|   RK   (    (    s   /usr/lib/python2.7/pydoc.pyt   writedoc2  s    $
R   c         C   sL   | d k r i  } n  x0 t j |  g |  D] \ } } } t |  q+ Wd S(   sA   Write out HTML documentation for all modules in a directory tree.N(   R_   R9  t   walk_packagesR  (   R   t   pkgpatht   doneRG  R*   RH  (    (    s   /usr/lib/python2.7/pydoc.pyt	   writedocs>  s
     	%t   Helperc           B   s  e  Z i d  d 6d d 6d(d 6d)d 6d*d 6d+d
 6d,d 6d-d 6d d 6d.d 6d d 6d/d 6d d 6d0d 6d d 6d1d 6d2d 6d3d 6d4d 6d  d! 6d5d" 6d  d$ 6d  d% 6d6d& 6d7d' 6d8d( 6d9d* 6d:d 6d;d+ 6d<d 6d=d. 6Z e d/   d>D  Z i d?e d7 6d@dL 6dAd  6dBdM 6dCdZ 6dDd[ 6dEd^ 6Z i d_ d> 6d` d; 6da db 6dc dd 6de df 6dg dh 6di dj 6d7 dk 6dl dm 6dn do 6dp dq 6dr ds 6dr dt 6du dv 6du dw 6Z xd e j   D]V \ Z Z	 xG e	 D]? Z
 e j e
 e  Z e e k re dx e Z n  e e e
 <qWqWiN dFd{ 6dGd7 6dHd 6dId 6dJd 6dKd 6dLd 6dMd 6dNd^ 6dOd 6d d 6dPd# 6dQd 6dRd 6dSd 6d{ d 6d{ d 6dTd 6dUde 6dVd 6dWd 6dXd 6dYd 6d d 6dZd 6d dL 6d d 6d[d 6d\d 6d]d 6d^d 6d_d 6d`d 6dad 6dbd 6dcd 6ddd 6ded 6dfd 6d d 6d d 6dgd) 6dhd 6did 6djd 6dkd 6dldl 6dmd 6d d 6dnd 6dod 6dpd 6dqd 6drd 6dsdp 6dtd 6dud 6dvd 6dwd 6dxd` 6dydM 6dzd 6d{d 6d|d[ 6d}d  6d~d  6d d6dd6ddZ 6d d6d' d6d* d	6d d
6d d6dd6dd 6dd6dd6Z ddd Z e d   Z e d   Z d  Z e   Z e d Z d  Z d  Z d  Z d  Z dd d! Z d"  Z d#  Z d$  Z d d% Z d&  Z d d' Z  RS(  t   BOOLEANt   andt   witht   ast   assertR   t   breaks	   while fort   classs   CLASSES SPECIALMETHODSt   continuet   functiont   deft   delt   BASICMETHODSt   ift   elift   elset   tryt   exceptt   exect   finallyt   fors   break continue whilet   importt   fromt   globalt
   NAMESPACESt
   TRUTHVALUEt   MODULESt   int   SEQUENCEMETHODS2t
   COMPARISONt   ist   lambdaR  t   nott   ort   passt   printt   raiset
   EXCEPTIONSt   returnt   whiles   break continue if TRUTHVALUEs    CONTEXTMANAGERS EXCEPTIONS yieldt   yieldc         c   s&   |  ] } d D] } | | Vq q d S(   t   'R  N(   R  R  (    (   t   .0t   pR  (    (    s   /usr/lib/python2.7/pydoc.pys	   <genexpr>u  s    R   R   t   uR  s   '''s   """R  t   STRINGSt   +RZ  t   *s   **R   s   //t   %s   <<s   >>R   t   |t   ^t   ~R   R   s   <=s   >=s   ==s   !=s   <>t	   OPERATORSt   UNARYs   +=s   -=s   *=s   /=s   %=s   &=s   |=s   ^=s   <<=s   >>=s   **=s   //=t   AUGMENTEDASSIGNMENTt   BITWISEt   jt   Jt   COMPLEXs   OPERATORS FORMATTINGt   POWERs   TUPLES LISTS FUNCTIONSt   ,s    ATTRIBUTES FLOAT MODULES OBJECTSR   t   ELLIPSISs   ...s   SLICINGS DICTIONARYLITERALSt   :s	   def classt   @s   \t   PRIVATENAMESRZ   s   PRIVATENAMES SPECIALMETHODSRY   t
   BACKQUOTESt   `s   TUPLES FUNCTIONS CALLSR  R  s   LISTS SUBSCRIPTS SLICINGSt   [t   ]R   R   sR   STRINGS UNICODE NUMBERS SEQUENCES MAPPINGS FUNCTIONS CLASSES MODULES FILES inspectt   TYPESt   stringss4   str UNICODE SEQUENCES STRINGMETHODS FORMATTING TYPESs   string-methodss   STRINGS FORMATTINGt   STRINGMETHODSt   formatstringst
   FORMATTINGs:   encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPESt   UNICODEt   numberss   INTEGER FLOAT COMPLEX TYPESt   NUMBERSt   integerss	   int ranget   INTEGERt   floatings
   float matht   FLOATt	   imaginarys   complex cmatht   typesseqs%   STRINGMETHODS FORMATTING xrange LISTSt	   SEQUENCESt   DICTIONARIESt   MAPPINGSt   typesfunctionss	   def TYPESt   typesmethodss   class def CLASSES TYPESt   METHODSs   bltin-code-objectss   compile FUNCTIONS TYPESt   CODEOBJECTSs   bltin-type-objectss   types TYPESt   TYPEOBJECTSt   FRAMEOBJECTSt
   TRACEBACKSs   bltin-null-objectt   NONEs   bltin-ellipsis-objectt   SLICINGSs   bltin-file-objectst   FILESt   specialattrst   SPECIALATTRIBUTESs!   class SPECIALMETHODS PRIVATENAMESR  t   typesmodulest   PACKAGESs   operator-summarys   lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIES BACKQUOTESt   EXPRESSIONSt
   PRECEDENCEt   objectst   OBJECTSt   specialnamesst   BASICMETHODS ATTRIBUTEMETHODS CALLABLEMETHODS SEQUENCEMETHODS1 MAPPINGMETHODS SEQUENCEMETHODS2 NUMBERMETHODS CLASSESt   SPECIALMETHODSt   customizations    cmp hash repr str SPECIALMETHODSs   attribute-accesss   ATTRIBUTES SPECIALMETHODSt   ATTRIBUTEMETHODSs   callable-typess   CALLS SPECIALMETHODSt   CALLABLEMETHODSs   sequence-typess)   SEQUENCES SEQUENCEMETHODS2 SPECIALMETHODSt   SEQUENCEMETHODS1s   sequence-methodss)   SEQUENCES SEQUENCEMETHODS1 SPECIALMETHODSs   MAPPINGS SPECIALMETHODSt   MAPPINGMETHODSs   numeric-typess*   NUMBERS AUGMENTEDASSIGNMENT SPECIALMETHODSt   NUMBERMETHODSt	   execmodels%   NAMESPACES DYNAMICFEATURES EXCEPTIONSt	   EXECUTIONt   namings*   global ASSIGNMENT DELETION DYNAMICFEATURESs   dynamic-featurest   DYNAMICFEATURESt   SCOPINGt   FRAMESR   s   try except finally raises   coercion-rulest   CONVERSIONSt	   COERCIONSt   conversionst   identifierss   keywords SPECIALIDENTIFIERSt   IDENTIFIERSs
   id-classest   SPECIALIDENTIFIERSs   atom-identifierss   atom-literalssH   STRINGS BACKQUOTES NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALSt   LITERALSt   TUPLESt	   exprlistss   TUPLES LITERALSt   TUPLELITERALSs   typesseq-mutablet   LISTLITERALSt   LISTSt   listss   LISTS LITERALSt   typesmappingt   DICTIONARYLITERALSR   s   DICTIONARIES LITERALSs   string-conversionss   repr str STRINGS LITERALSs   attribute-referencess(   getattr hasattr setattr ATTRIBUTEMETHODSt
   ATTRIBUTESt   subscriptionst
   SUBSCRIPTSt   slicingst   callst   CALLSt   powert   unaryt   binaryt   BINARYt   shiftingt   SHIFTINGt   bitwiset   comparisonss   EXPRESSIONS BASICMETHODSt   booleanss   EXPRESSIONS TRUTHVALUEt	   ASSERTIONt
   assignmentt
   ASSIGNMENTt	   augassignt   DELETIONt   PRINTINGt	   RETURNINGt	   IMPORTINGt   CONDITIONALt   compounds   for while break continuet   LOOPINGt   truths    if while and or not BASICMETHODSt   debuggert   pdbt	   DEBUGGINGs   context-managerst   CONTEXTMANAGERSc         C   s   | |  _  | |  _ d  S(   N(   t   _inputt   _output(   R   t   inputt   output(    (    s   /usr/lib/python2.7/pydoc.pyRt     s    	c         C   s   |  j  p t j S(   N(   Rz  R   R  (   R   (    (    s   /usr/lib/python2.7/pydoc.pyR(    R   c         C   s   |  j  p t j S(   N(   R{  R   R  (   R   (    (    s   /usr/lib/python2.7/pydoc.pyR(    R   c         C   s)   t  j   d d d k r% |    d Sd S(   Ni   i   t   ?R   s   <pydoc.Helper instance>(   R   t   stack(   R   (    (    s   /usr/lib/python2.7/pydoc.pyt   __repr__  s    c         C   sG   | |  j  k	 r |  j |  n$ |  j   |  j   |  j j d  d  S(   Ns  
You are now leaving help and returning to the Python interpreter.
If you want to ask for help on a particular object directly from the
interpreter, you can type "help(object)".  Executing "help('string')"
has the same effect as typing a particular string at the help> prompt.
(   t   _GoInteractivet   helpt   introt   interactR}  R  (   R   t   request(    (    s   /usr/lib/python2.7/pydoc.pyRX    s    

	c         C   s   |  j  j d  x t r y |  j d  } | s5 Pn  Wn t t f k
 rP Pn Xt |  } t |  d k r | d | d k o d k n r | d | d d !k r | d d !} n  t |  d k r Pn  |  j	 |  q Wd  S(   Ns   
s   help> i   i    iR  R  i   R  t   quit(   R  R  (   R  R  (
   R}  R  Rv   t   getlinet   KeyboardInterruptt   EOFErrorR   R&   R   R  (   R   R  (    (    s   /usr/lib/python2.7/pydoc.pyR    s    	 6 c         C   sJ   |  j  t j k r t |  S|  j j |  |  j j   |  j  j   Sd S(   s.   Read one line, using raw_input when available.N(   R|  R   R  t	   raw_inputR}  R  R  R{   (   R   t   prompt(    (    s   /usr/lib/python2.7/pydoc.pyR  #  s
    
c         C   s{  t  |  t  d  k rA| j   } | d k r= |  j   qg| d k rV |  j   qg| d k ro |  j   qg| d k r |  j   qg| d k r |  j   qg| d  d k r |  j t |  d	  qg| |  j k r |  j	 |  qg| |  j
 k r	|  j |  qg| |  j k r(|  j |  qg| rgt | d
  qgn& t | t  rZ|    n t | d
  |  j j d  d  S(   NR   R  t   keywordst   symbolst   topicsR   i   s   modules i   s   Help on %s:s   
(   R   R   R  t   listkeywordst   listsymbolst
   listtopicst   listmodulesR   R  t
   showsymbolR  t	   showtopicR  R'   Rn   R  R}  R  (   R   R  (    (    s   /usr/lib/python2.7/pydoc.pyR  ,  s4              
c         C   s,   |  j  j d t t j d  g d   d  S(   Ns  
Welcome to Python %s!  This is the online help utility.

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/%s/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics".  Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".
i   i   (   R}  R  t   tupleR   R   (   R   (    (    s   /usr/lib/python2.7/pydoc.pyR  >  s    	i   iP   c   	   	   C   s   | } | j    | | } t |  | d | } x t |  D] } x t |  D]z } | | | } | t |  k  rS |  j j | |  | | d k  r |  j j d d | d t | |   q qS qS W|  j j d  q@ Wd  S(   Ni   R   s   
(   R;  R&   R   R}  R  (	   R   t   itemst   columnsR   t   colwR   t   rowR   R   (    (    s   /usr/lib/python2.7/pydoc.pyR   O  s    

4c         C   s*   |  j  j d  |  j |  j j    d  S(   NsN   
Here is a list of the Python keywords.  Enter any keyword to get more help.

(   R}  R  R   R  RF   (   R   (    (    s   /usr/lib/python2.7/pydoc.pyR  ]  s    	c         C   s*   |  j  j d  |  j |  j j    d  S(   Nsx   
Here is a list of the punctuation symbols which Python assigns special meaning
to. Enter any symbol to get more help.

(   R}  R  R   R  RF   (   R   (    (    s   /usr/lib/python2.7/pydoc.pyR  d  s    	c         C   s*   |  j  j d  |  j |  j j    d  S(   NsN   
Here is a list of available topics.  Enter any topic name to get more help.

(   R}  R  R   R  RF   (   R   (    (    s   /usr/lib/python2.7/pydoc.pyR  l  s    	c         C   s  y d d  l  } Wn" t k
 r4 |  j j d  d  SX|  j j | |  j j |   } | sz |  j j d t |   d  St |  t d  k r |  j	 | |  S| \ } } y | j j | } Wn, t
 k
 r |  j j d t |   d  SXt t |  d  | r"| pd d | } n  | rd d  l } d d  l }	 | j   }
 |	 j |
  j d t t |  d  d  |  j j d	 |
 j    n  d  S(
   Nist   
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
s   no documentation found for %s
R   s   
R   s   Related help topics: s   , s   
%s
(   t   pydoc_data.topicsR   R}  R  R  R   R  R   R   R  t   KeyErrorR  R   t   StringIOt	   formattert
   DumbWritert   send_flowing_dataR   R   t   getvalue(   R   t   topict
   more_xrefst
   pydoc_datat   targett   labelt   xrefsR'   R  R  t   buffer(    (    s   /usr/lib/python2.7/pydoc.pyR  s  s6    	!c         C   s9   |  j  | } | j d  \ } } } |  j | |  d  S(   NR   (   R  t	   partitionR  (   R   t   symbolR  R  RZ   R  (    (    s   /usr/lib/python2.7/pydoc.pyR    s    c            s   | r# |  j  j d  t |  nj |  j  j d  i  } | d      f d   } t   j   d | |  j | j    |  j  j d  d  S(   NsO   
Here is a list of matching modules.  Enter any module name to get more help.

sI   
Please wait a moment while I gather a list of all available modules...

c         S   sM   | r' | d d k r' | d  d } n  t  | d  d k  rI d | | <n  d  S(   Nis	   .__init__s
    (package)R   i    i   (   R   (   R   R*   R  R   (    (    s   /usr/lib/python2.7/pydoc.pyt   callback  s    c            s     d  |  d   d  S(   N(   R_   (   R*   (   R  (    s   /usr/lib/python2.7/pydoc.pyt   onerror  s    R  s   
Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose descriptions contain the word "spam".
(   R}  R  t   apropost   ModuleScannert   runR   RF   (   R   RJ   R   R  (    (   R  s   /usr/lib/python2.7/pydoc.pyR    s    			(   R  R   (   R  s	   while for(   R  s   CLASSES SPECIALMETHODS(   R  s	   while for(   R  R   (   R  R  (   R  s	   while for(   R  R   (   R  s   break continue while(   R  R  (   R  R  (   R  R  (   R  R  (   R  R  (   R  R   (   R  R   (   R  R  (   R  R  (   R  R  (   R  s   break continue if TRUTHVALUE(   R  s    CONTEXTMANAGERS EXCEPTIONS yield(   R  R   (   R   R   R  (   R  s   '''s   """R  (   R  RZ  R  s   **R   s   //R  s   <<s   >>R   R  R  R	  R   R   s   <=s   >=s   ==s   !=s   <>(   R   R   s   <=s   >=s   ==s   !=s   <>(   RZ  R	  (   s   +=s   -=s   *=s   /=s   %=s   &=s   |=s   ^=s   <<=s   >>=s   **=s   //=(   s   <<s   >>R   R  R  R	  (   R  R  (   R   sR   STRINGS UNICODE NUMBERS SEQUENCES MAPPINGS FUNCTIONS CLASSES MODULES FILES inspect(   R  s4   str UNICODE SEQUENCES STRINGMETHODS FORMATTING TYPES(   s   string-methodss   STRINGS FORMATTING(   R  R
  (   R  s:   encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPES(   R!  s   INTEGER FLOAT COMPLEX TYPES(   R#  s	   int range(   R%  s
   float math(   R'  s   complex cmath(   R(  s%   STRINGMETHODS FORMATTING xrange LISTS(   R,  s	   def TYPES(   R-  s   class def CLASSES TYPES(   s   bltin-code-objectss   compile FUNCTIONS TYPES(   s   bltin-type-objectss   types TYPES(   s   bltin-null-objectR   (   s   bltin-ellipsis-objectR4  (   s   bltin-file-objectsR   (   R6  R   (   R   s!   class SPECIALMETHODS PRIVATENAMES(   R8  R  (   s   operator-summarys   lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIES BACKQUOTES(   R<  R  (   R>  st   BASICMETHODS ATTRIBUTEMETHODS CALLABLEMETHODS SEQUENCEMETHODS1 MAPPINGMETHODS SEQUENCEMETHODS2 NUMBERMETHODS CLASSES(   R@  s    cmp hash repr str SPECIALMETHODS(   s   attribute-accesss   ATTRIBUTES SPECIALMETHODS(   s   callable-typess   CALLS SPECIALMETHODS(   s   sequence-typess)   SEQUENCES SEQUENCEMETHODS2 SPECIALMETHODS(   s   sequence-methodss)   SEQUENCES SEQUENCEMETHODS1 SPECIALMETHODS(   s   sequence-typess   MAPPINGS SPECIALMETHODS(   s   numeric-typess*   NUMBERS AUGMENTEDASSIGNMENT SPECIALMETHODS(   RF  s%   NAMESPACES DYNAMICFEATURES EXCEPTIONS(   RH  s*   global ASSIGNMENT DELETION DYNAMICFEATURES(   s   dynamic-featuresR   (   R   s   try except finally raise(   s   coercion-rulesRL  (   RN  RM  (   RO  s   keywords SPECIALIDENTIFIERS(   s
   id-classesR   (   s   atom-identifiersR   (   s   atom-literalssH   STRINGS BACKQUOTES NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS(   RT  s   TUPLES LITERALS(   s   typesseq-mutableRV  (   RX  s   LISTS LITERALS(   RY  RZ  (   R   s   DICTIONARIES LITERALS(   s   string-conversionss   repr str STRINGS LITERALS(   s   attribute-referencess(   getattr hasattr setattr ATTRIBUTEMETHODS(   R\  RC  (   R^  R  (   R_  R:  (   Ra  R:  (   Rb  R:  (   Rc  R:  (   Re  R:  (   Rg  R:  (   Rh  s   EXPRESSIONS BASICMETHODS(   Ri  s   EXPRESSIONS TRUTHVALUE(   Rk  R  (   Rm  RE  (   Rs  s   for while break continue(   Ru  s    if while and or not BASICMETHODS(   Rv  Rw  (   s   context-managersR  N(!   R   R   R  R  t   _strprefixest   _symbols_inverseR  t	   iteritemsR  t   symbols_R  R   R  R_   Rt   R   R|  R}  R  R$   R  RX  R  R  R  R  R   R  R  R  R  R  R  (    (    (    s   /usr/lib/python2.7/pydoc.pyR  E  sB  
  


										 	t   Scannerc           B   s    e  Z d  Z d   Z d   Z RS(   s   A generic tree iterator.c         C   s)   | |  _  g  |  _ | |  _ | |  _ d  S(   N(   t   rootst   statet   childrent   descendp(   R   R  R  R  (    (    s   /usr/lib/python2.7/pydoc.pyRt     s    
		c         C   s   |  j  sF |  j s d  S|  j j d  } | |  j |  f g |  _  n  |  j  d \ } } | sv |  j  j   |  j   S| j d  } |  j |  r |  j  j | |  j |  f  n  | S(   Ni    i(   R  R  R_   R   R  t   nextR  R   (   R   t   roott   nodeR  t   child(    (    s   /usr/lib/python2.7/pydoc.pyR    s    		
"(   R   R   RT   Rt   R  (    (    (    s   /usr/lib/python2.7/pydoc.pyR    s   	R  c           B   s    e  Z d  Z d d d d  Z RS(   s7   An interruptible scanner that searches module synopses.c         C   s  | r t  |  } n  t |  _ i  } x t j D] } | d k r. d | | <| d  k ri | d  | d  q t t |  j p~ d d  d } t	 t  | d |  |  d k r | d  | |  q q. q. Wx@t
 j d |  D],\ } } }	 |  j r Pn  | d  k r| d  | d  q | j |  }
 t |
 d  rd	 d  l } t | j |
 j |    pad } t |
 d
  r|
 j |  } qd  } nC |
 j |  } | j r| j j   d n d } t | d d   } t	 t  | d |  |  d k r | | | |  q q W| r|   n  d  S(   Nt   __main__i   R   s   
i    s    - R  t
   get_sourceit   get_filenameRU   (   R   Rw   R  R   R   R_   R   R   RT   R   R9  R  t   find_moduleR^   R  R~   R  R  R   R   RG   (   R   R  RJ   t	   completerR  t   seenR*   R  RG  RH  t   loaderR  R   R   (    (    s   /usr/lib/python2.7/pydoc.pyR    sB     	
"#"		"#N(   R   R   RT   R_   R  (    (    (    s   /usr/lib/python2.7/pydoc.pyR    s   c      	   C   sO   d   } d   } t  j   + t  j d  t   j | |  d | Wd QXd S(   sA   Print all the one-line module summaries that contain a substring.c         S   s8   | d d k r! | d  d } n  | G| o2 d | GHd  S(   Nis	   .__init__s
    (package)s   - (    (   R   R*   R  (    (    s   /usr/lib/python2.7/pydoc.pyR    s    c         S   s   d  S(   N(    (   R*   (    (    s   /usr/lib/python2.7/pydoc.pyR    s    t   ignoreR  N(   t   warningst   catch_warningst   filterwarningsR  R  (   RJ   R  R  (    (    s   /usr/lib/python2.7/pydoc.pyR    s
    		c   	      C   s   d d  l  } d d  l } d d  l } d | j f d     Y} d | j f d     Y} d | j f d     Y} | j | _ | | _ | | _ z8 y | |  |  j	   Wn t
 | j f k
 r n XWd  | r |   n  Xd  S(   Nit   Messagec           B   s   e  Z d  d  Z RS(   i   c         S   sf   |  j  } | j d j d j |  | |  |  j d  |  _ |  j d  |  _ |  j   |  j   d  S(   Ni    s   content-transfer-encodings   content-type(   R   RC   Rt   t	   getheadert   encodingheadert
   typeheadert	   parsetypet
   parseplist(   R   t   fpt   seekableR  (    (    s   /usr/lib/python2.7/pydoc.pyRt     s    	!
(   R   R   Rt   (    (    (    s   /usr/lib/python2.7/pydoc.pyR    s   t
   DocHandlerc           B   s#   e  Z d    Z d   Z d   Z RS(   c         S   s_   yG |  j  d  |  j d d  |  j   |  j j t j | |   Wn t k
 rZ n Xd  S(   Ni   s   Content-Types	   text/html(   t   send_responset   send_headert   end_headerst   wfileR  R  R   R   (   R   R   R   (    (    s   /usr/lib/python2.7/pydoc.pyt   send_document  s    
  c         S   s  |  j  } | d d k r& | d  } n  | d  d k rC | d } n  | r | d k r y t | d d } Wn3 t k
 r } |  j | t j t |    d  SX| r |  j t |  t j | |   q|  j | d t	 |   n t j
 d d	 d
  } d   } t d   t j  } t j | |  } d t j d d	 d |  g } i  }	 x* t j  D] }
 | j t j |
 |	   q]W| t |  d } |  j d |  d  S(   Nis   .htmli   R   R   R   s$   no Python documentation found for %ss?   <big><big><strong>Python: Index of Modules</strong></big></big>s   #ffffffs   #7799eec         S   s   d |  |  f S(   Ns   <a href="%s.html">%s</a>(    (   R+   (    (    s   /usr/lib/python2.7/pydoc.pyt	   bltinlink0  s    c         S   s
   |  d k S(   NR  (    (   RQ   (    (    s   /usr/lib/python2.7/pydoc.pyR(  2  R   s   <p>s   Built-in Moduless   #ee77aas   <p align=right>
<font color="#909090" face="helvetica, arial"><strong>
pydoc</strong> by Ka-Ping Yee &lt;ping@lfw.org&gt;</font>s   Index of Modules(   R   R  R   R  R  R   Rr   R  R   R   R   Rb  R   R   R   R   R   R|  R   (   R   R   R@   RK   R   R  t   namesR   t   indicesR  R   (    (    s   /usr/lib/python2.7/pydoc.pyt   do_GET  s<    	  %				c         W   s   d  S(   N(    (   R   R   (    (    s   /usr/lib/python2.7/pydoc.pyt   log_message@  R   (   R   R   R  R  R  (    (    (    s   /usr/lib/python2.7/pydoc.pyR    s   		#t	   DocServerc           B   s#   e  Z d    Z d   Z d   Z RS(   c         S   s>   d } | | f |  _  | |  _ |  j j |  |  j  |  j  d  S(   Nt	   localhost(   t   addressR  RL   Rt   t   handler(   R   t   portR  t   host(    (    s   /usr/lib/python2.7/pydoc.pyRt   C  s    	c         S   si   d d  l  } t |  _ xM |  j sd | j  |  j j   g g  g  d  \ } } } | r |  j   q q Wd  S(   Nii   (   t   selectRw   R  t   socketR  t   handle_request(   R   R  t   rdt   wrt   ex(    (    s   /usr/lib/python2.7/pydoc.pyt   serve_until_quitI  s    	- c         S   sJ   |  j  j |   d |  j d |  j f |  _ |  j rF |  j |   n  d  S(   Ns   http://%s:%d/i    (   RL   t   server_activateR  t   server_portR  R  (   R   (    (    s   /usr/lib/python2.7/pydoc.pyR  P  s    	 (   R   R   Rt   R  R  (    (    (    s   /usr/lib/python2.7/pydoc.pyR  B  s   		(   t   BaseHTTPServert	   mimetoolsR  R  t   BaseHTTPRequestHandlert
   HTTPServerRL   R  t   MessageClassR  R  t   error(	   R  R  R  R  R  R  R  R  R  (    (    s   /usr/lib/python2.7/pydoc.pyt   serve  s    $	.		 c          C   so   d d d     Y}  d d l  } y8 | j   } z |  |  } | j   Wd | j   XWn t k
 rj n Xd S(   sE   Graphical interface (starts web server and pops up a control window).t   GUIc           B   s   e  Z d  d  Z d   Z d d d  Z d d  Z d d  Z d   Z d d  Z	 d   Z
 d d	  Z d d
  Z d   Z d   Z d d  Z RS(   i(  c      
   S   s  | |  _  d  |  _ d  |  _ d d  l } | j |  |  _ | j |  j d d |  _ | j	 |  j d d d |  j
 d d |  _ | j	 |  j d d d |  j d d |  _ | j |  |  _ | j |  j d d	 |  _ | j |  j  |  _ |  j j d
 |  j  | j	 |  j d d d d d |  j d d |  _ t j d k rU|  j j d d  n  |  j  j d  |  j  j d |  j  |  j j d d d d  |  j j d d d d d d  |  j j d d d d d d  |  j j d d d d  |  j j d d  |  j j d d d d d d  |  j j d d d d  |  j j   d t j d k r[d p^d f } | j | d | d d |  _ |  j j d |  j  |  j j d  |  j  | j  | d! d" d |  j j! |  _" |  j j# d# |  j" j$  | j |  |  _% | j	 |  j% d d$ d |  j |  _& | j	 |  j% d d% d |  j' |  _( |  j& j d d d d d d  |  j( j d d d d d d  |  j  j)   |  j  j*   |  _+ |  j  j,   |  _- |  j j.   |  j j.   |  j j.   |  j% j.   |  _/ |  j+ |  j/ |  _0 |  _1 d |  _2 |  j  j3 d& |  j+ |  j- f  |  j  j4 |  j+ |  j-  |  j  j5 j6   d d  l7 } | j8 d' t9 d( | |  j: |  j f  j;   d  S()   NiR4   s   Starting server...
 s   open browsert   commandR  t   disableds   quit servings
   Search fors   <Return>t   stopt   padyi    R#  t   sidet   rightt   pydoct   WM_DELETE_WINDOWt   topt   fillRQ   t   leftt   expandi   t	   helveticai   i
   t   fontt   heighti   s
   <Button-1>s   <Double-Button-1>t   orientt   verticalt   yscrollcommands   go to selecteds   hide resultss   %dx%dR  R   (<   t   windowR_   t   servert   scannert   Tkintert   Framet
   server_frmt   Labelt	   title_lblt   ButtonR   t   open_btnR  t   quit_btnt
   search_frmt
   search_lblt   Entryt
   search_entt   bindR
  R  t   stop_btnR   R2  t   packR   t   protocolt	   focus_sett   Listboxt
   result_lstR  t   gotot	   Scrollbart   yviewt
   result_scrt   configR  t
   result_frmt   goto_btnt   hidet   hide_btnRD   t   winfo_widtht   minwidtht   winfo_heightt	   minheightt   winfo_reqheightt   bigminheightt   bigwidtht	   bigheightt   expandedt   wm_geometryt
   wm_minsizet   tkt   willdispatcht	   threadingt   ThreadR  t   readyR  (   R   R  R  R  R  R/  (    (    s   /usr/lib/python2.7/pydoc.pyRt   e  sp    			!!&	 	c         S   sM   | |  _  |  j j d d | j  |  j j d d  |  j j d d  d  S(   NR4   s   Python documentation server at
R  t   normal(   R  R
  R  R  R  R  (   R   R  (    (    s   /usr/lib/python2.7/pydoc.pyR1    s
    	c         S   s   | p |  j  j } y d d  l } | j |  Wna t k
 r t j d k rb t j d |  q t j d |  } | r t j d |  q n Xd  S(   NiR#  s
   start "%s"s    netscape -remote "openURL(%s)" &s   netscape "%s" &(	   R  R  t
   webbrowserR   R   R   R2  R   R  (   R   t   eventR  R3  t   rc(    (    s   /usr/lib/python2.7/pydoc.pyR     s     c         S   s)   |  j  r d |  j  _ n  |  j j   d  S(   Ni   (   R  R  R  (   R   R4  (    (    s   /usr/lib/python2.7/pydoc.pyR    s    	c      	   S   s  |  j  j   } |  j j d d  |  j j d d  |  j j d d |  |  j  j   |  j j d d  |  j j d d	  |  j	 j d d
  |  j
   d d  l } |  j r d |  j _ n  t   |  _ d   } | j d |  j j d |  j | |  j f d t d |   j   d  S(   NR  R  R  R2  R4   s   Searching for "%s"...R  i    R  R  ii   c         S   s   d  S(   N(    (   R*   (    (    s   /usr/lib/python2.7/pydoc.pyR    s    R  R   t   kwargsR  (   R  R   R  R  R  R  t   forgetR  t   deleteR  R  R/  R  R  R  R0  R  RD   R  R   R  (   R   R4  RJ   R/  R  (    (    s   /usr/lib/python2.7/pydoc.pyR
    s"    
		c         S   sF   | d d k r! | d  d } n  |  j  j d | d | p= d  d  S(   Nis	   .__init__s
    (package)R  s    - s   (no description)(   R  t   insert(   R   R   R*   R  (    (    s   /usr/lib/python2.7/pydoc.pyRD     s    c         S   s%   |  j  r! d |  j  _ d  |  _  n  d  S(   Ni   (   R  R  R_   (   R   R4  (    (    s   /usr/lib/python2.7/pydoc.pyR    s    	c         S   s   d  |  _ |  j j d d  |  j j d d  |  j j d d d d d d	  t j d
 k rm |  j j	   n  |  j j d d  d  S(   NR4   s
   Search forR  R  R  R  RQ   R  i   R#  R  R  (
   R_   R  R  R  R  R  R   R2  R  R7  (   R   (    (    s   /usr/lib/python2.7/pydoc.pyR    s    	 c         S   s   |  j  j d d  d  S(   NR  R2  (   R  R  (   R   R4  (    (    s   /usr/lib/python2.7/pydoc.pyR    s    c         S   sZ   |  j  j   } | rV t |  j  j | d   d } |  j d |  j j | d  n  d  S(   Ni    R  s   .html(   R  t   curselectionR   R   R   R  R  (   R   R4  t	   selectionR*   (    (    s   /usr/lib/python2.7/pydoc.pyR    s     c         S   s   |  j  s d  S|  j j   |  j j   |  j j   |  j j   |  _ |  j j   |  _	 |  j j
 d |  j |  j f  |  j j |  j |  j  d |  _  d  S(   Ns   %dx%di    (   R*  R  R7  R  R  R  R"  R(  R$  R)  R+  R#  R%  R,  (   R   (    (    s   /usr/lib/python2.7/pydoc.pyt   collapse  s    	  c         S   s   |  j  r d  S|  j j d d d d  |  j j d d d d  |  j j d d d d d	 d
  |  j j d |  j |  j f  |  j j	 |  j
 |  j  d
 |  _  d  S(   NR  t   bottomR  RQ   R  t   yR  t   bothR  i   s   %dx%d(   R*  R  R  R  R  R  R+  R(  R)  R,  R#  R'  (   R   (    (    s   /usr/lib/python2.7/pydoc.pyR    s    	  c         S   s   |  j    |  j   d  S(   N(   R  R<  (   R   R4  (    (    s   /usr/lib/python2.7/pydoc.pyR   	  s    
N(   R   R   Rt   R1  R_   R   R  R
  RD   R  R  R  R  R<  R  R   (    (    (    s   /usr/lib/python2.7/pydoc.pyR  d  s   E						iN(    (   R  t   Tkt   mainloopt   destroyR  (   R  R  R  t   gui(    (    s   /usr/lib/python2.7/pydoc.pyRC  b  s    c         C   s%   t  |  t  o$ t |  t j  d k S(   Ni    (   Rn   Rr   R   R   t   sep(   RQ   (    (    s   /usr/lib/python2.7/pydoc.pyt   ispath	  s    c          C   s  d d l  }  d d d     Y} d t j k r t j j t j d  } | t j k ri t j j |  n  t j j d d  n  y|  j  t j d d	  \ } } d } x | D] \ } } | d
 k r t   d S| d k r t	 |  d S| d k rGy t
 |  } Wn t k
 r |  n Xd   }	 d   }
 t | |	 |
  d S| d k r d } q q W| so|  n  x | D] } t |  rt j j |  rd | GHPn  y| t |  rt j j |  rt |  } n  | rt |  r	t j j |  r	t |  q#t |  n t j |  Wqvt k
 r>} | GHqvXqvWWnW |  j | f k
 rt j j t j d  } d | t j | | | | t j f GHn Xd S(   s@   Command-line interface (looks at sys.argv to decide what to do).iNt   BadUsagec           B   s   e  Z RS(    (   R   R   (    (    (    s   /usr/lib/python2.7/pydoc.pyRF  "	  s    R   i    R   i   s   gk:p:ws   -gs   -ks   -pc         S   s   d |  j  GHd  S(   Ns   pydoc server ready at %s(   R  (   R  (    (    s   /usr/lib/python2.7/pydoc.pyR1  <	  s    c           S   s	   d GHd  S(   Ns   pydoc server stopped(    (    (    (    s   /usr/lib/python2.7/pydoc.pyt   stopped>	  s    s   -ws   file %r does not exists  pydoc - the Python documentation tool

%s <name> ...
    Show text documentation on something.  <name> may be the name of a
    Python keyword, topic, function, module, or package, or a dotted
    reference to a class or function within a module or module in a
    package.  If <name> contains a '%s', it is used as the path to a
    Python source file to document. If name is 'keywords', 'topics',
    or 'modules', a listing of these things is displayed.

%s -k <keyword>
    Search for a keyword in the synopsis lines of all available modules.

%s -p <port>
    Start an HTTP server on the given port on the local machine.  Port
    number 0 can be used to get an arbitrary unused port.

%s -g
    Pop up a graphical interface for finding and serving documentation.

%s -w <name> ...
    Write out the HTML documentation for a module to a file in the current
    directory.  If <name> contains a '%s', it is treated as a filename; if
    it names a directory, documentation is written for all the contents.
(    (   t   getoptR   R   R   t   dirnamet   argvt   removeR9  RC  R  R  R  R  RE  t   existsRu   R   R   R  R  R  R   R  R   RD  (   RH  RF  t	   scriptdirt   optsR   t   writingt   optt   valR  R1  RG  t   argRK   R  (    (    s   /usr/lib/python2.7/pydoc.pyt   cli	  s^    

		 		R  (b   RT   R-  R&  R$  R/  R   R   R   R"   R   R   Rc  R9  R  R   R    t   stringR   R   R   R   R   R   R   R   t	   tracebackR	   t   collectionsR
   R   R   R   R   R)   R,   R3   R6   R;   R	  t
   IGNORECASER<   R=   RA   RE   RR   R_   Rb   Ri   Ro   Rj   t	   NameErrorR$   Rq   R!   t   localet   getpreferredencodingRs   Ry   R~   R   RN  R   R   R   R   R   R   R~  R  R  R  R  R  R  R  R  R  R  R4   R  R  R   R  R  R  R'   R  R  R  R  R  R  R  R  RC  RE  RS  R   (    (    (    s   /usr/lib/python2.7/pydoc.pyt   <module>$   s   
l:											
		
					2:*  %  Y		#					,				 o	,	[			T 