B
    u9a+                 @   s<   d dl Z G dd deZG dd deZG dd deZdS )    Nc               @   s&   e Zd Zdd Zdd ZdddZdS )	Quitterc             C   s   || _ || _d S )N)nameeof)selfr   r    r   #/usr/lib/python3.7/_sitebuiltins.py__init__   s    zQuitter.__init__c             C   s   d| j | jf S )NzUse %s() or %s to exit)r   r   )r   r   r   r   __repr__   s    zQuitter.__repr__Nc             C   s(   yt j  W n   Y nX t|d S )N)sysstdinclose
SystemExit)r   coder   r   r   __call__   s
    zQuitter.__call__)N)__name__
__module____qualname__r   r	   r   r   r   r   r   r      s   r   c               @   s2   e Zd ZdZdddZdd Zdd Zd	d
 ZdS )_Printer   r   c                s4   dd l || _|| _d | _ fdd|D | _d S )Nr   c                s$   g | ]} D ]}j ||qqS r   )pathjoin).0dirfilename)filesosr   r   
<listcomp>(   s   z%_Printer.__init__.<locals>.<listcomp>)r   _Printer__name_Printer__data_Printer__lines_Printer__filenames)r   r   datar   dirsr   )r   r   r   r   #   s    z_Printer.__init__c          
   C   s~   | j r
d S d }xH| jD ]>}y$t|d}| }W d Q R X P W q tk
rR   Y qX qW |sb| j}|d| _ t| j | _d S )Nr
)	r   r    openreadOSErrorr   splitlen_Printer__linecnt)r   r!   r   fpr   r   r   __setup,   s    
z_Printer.__setupc             C   s8   |    t| j| jkr$d| jS d| jfd  S d S )Nr$   z!Type %s() to see the full %s text   )_Printer__setupr)   r   MAXLINESr   r   )r   r   r   r   r	   <   s    z_Printer.__repr__c             C   s   |    d}d}xy,x&t||| j D ]}t| j|  q&W W n tk
rT   P Y qX || j7 }d }x |d krt|}|dkrfd }qfW |dkrP qW d S )Nz0Hit Return for more, or q (and Return) to quit: r   ) qr1   )r.   ranger/   printr   
IndexErrorinput)r   promptlinenoikeyr   r   r   r   C   s"    

z_Printer.__call__N)r   r   )r   r   r   r/   r   r.   r	   r   r   r   r   r   r      s
   
	r   c               @   s   e Zd Zdd Zdd ZdS )_Helperc             C   s   dS )NzHType help() for interactive help, or help(object) for help about object.r   )r   r   r   r   r	   b   s    z_Helper.__repr__c             O   s   dd l }|j||S )Nr   )pydochelp)r   argskwdsr;   r   r   r   r   e   s    z_Helper.__call__N)r   r   r   r	   r   r   r   r   r   r:   X   s   
r:   )r
   objectr   r   r:   r   r   r   r   <module>   s   ;