Fa+ @sXdZddlZGdddeZGdddeZGdddeZdS) z= The objects used by the site module to add custom builtins. Nc@s7eZdZddZddZdddZdS)QuittercCs||_||_dS)N)nameeof)selfrrr#/usr/lib/python3.5/_sitebuiltins.py__init__s zQuitter.__init__cCsd|j|jfS)NzUse %s() or %s to exit)rr)rrrr__repr__szQuitter.__repr__Nc Cs,ytjjWnYnXt|dS)N)sysstdinclose SystemExit)rcoderrr__call__s zQuitter.__call__)__name__ __module__ __qualname__rr rrrrrr s   rc@sReZdZdZdZffddZddZddZd d Zd S) _Printerzninteractive prompt objects for printing the license text, a list of contributors and the copyright notice.csJddl||_||_d|_fdd|D|_dS)Nrcs2g|](}D]}jj||qqSr)pathjoin).0dirfilename)filesosrr (s z%_Printer.__init__..)r_Printer__name_Printer__data_Printer__lines_Printer__filenames)rrdatardirsr)rrrr#s     z_Printer.__init__cCs|jr dSd}xP|jD]E}y*t|d}|j}WdQRXPWqtk raYqXqW|su|j}|jd|_t|j|_dS)Nr ) rr openreadOSErrorrsplitlenZ_Printer__linecnt)rr!rfprrrZ__setup,s    z_Printer.__setupcCsH|jt|j|jkr2dj|jSd|jfdSdS)Nr$z!Type %s() to see the full %s text)_Printer__setupr)rMAXLINESrr)rrrrr <s z_Printer.__repr__c Cs|jd}d}xy6x/t|||jD]}t|j|q3WWntk rdPYqX||j7}d}x.|dkrt|}|dkr{d}q{W|dkrPqWdS)Nz0Hit Return for more, or q (and Return) to quit: rq)r.r/)r,ranger-printr IndexErrorinput)rZpromptlinenoikeyrrrrCs"       z_Printer.__call__N) rrr__doc__r-rr,r rrrrrrs   rc@s.eZdZdZddZddZdS)_Helpera3Define the builtin 'help'. This is a wrapper around pydoc.help that provides a helpful message when 'help' is typed at the Python interactive prompt. Calling help() at the Python prompt starts an interactive help session. Calling help(thing) prints help for the python object 'thing'. cCsdS)NzHType help() for interactive help, or help(object) for help about object.r)rrrrr bsz_Helper.__repr__cOsddl}|j||S)Nr)pydochelp)rargskwdsr9rrrres z_Helper.__call__N)rrrr7r rrrrrr8Xs  r8)r7r objectrrr8rrrrs ;