Edit File: help.pyc
� ��7ec�����������@���sT��d��Z��d�d�l�m�Z�d�d�l�m�Z�m�Z�m�Z�m�Z�m�Z�d�d�l�m �Z �d�d�l �m�Z�m�Z�m �Z �m�Z�m�Z�m�Z�m�Z�d�d�l�Z�d�d�l�m�Z�e�Z�e�r��d�d�l�m�Z�n��d �e�f�d �������YZ�d�e�f�d�������YZ�d �e �f�d�������YZ�d�e�f�d�������YZ�d����Z�d����Z�e�d�k�rPd�d�l �m!�Z!�e!�e���n��d�S(���s�� help.py: Implement the Idle help menu. Contents are subject to revision at any time, without notice. Help => About IDLE: diplay About Idle dialog <to be moved here from aboutDialog.py> Help => IDLE Help: Display help.html with proper formatting. Doc/library/idle.rst (Sphinx)=> Doc/build/html/library/idle.html (help.copy_strip)=> Lib/idlelib/help.html HelpParser - Parse help.html and render to tk Text. HelpText - Display formatted help.html. HelpFrame - Contain text, scrollbar, and table-of-contents. (This will be needed for display in a future tabbed window.) HelpWindow - Display HelpFrame in a standalone window. copy_strip - Copy idle.html to help.html, rstripping each line. show_idlehelp - Create HelpWindow. Called in EditorWindow.help_dialog. i����(���t ���HTMLParser(���t���abspatht���dirnamet���isdirt���isfilet���join(���t���python_version(���t���Tkt���Toplevelt���Framet���Textt ���Scrollbart���Menut ���MenubuttonN(���t���idleConf(���R ���t ���HelpParserc�����������B���sG���e��Z�d��Z�d����Z�d�d���Z�d����Z�d����Z�d����Z�d����Z�RS(���s~��Render help.html into a text widget. The overridden handle_xyz methods handle a subset of html tags. The supplied text should have the needed tag configurations. The behavior for unsupported tags, such as table, is undefined. If the tags generated by Sphinx change, this class, especially the handle_starttag and handle_endtags methods, might have to also. c���������C���s}���t��j�|����|�|��_�d�|��_�d�|��_�t�|��_�t�|��_�d�|��_�t�|��_ �d�|��_ �t�|��_�t�|��_�g��|��_ �d�|��_�d��S(���Nt����i����(���R����t���__init__t���textt���tagst���chartagst���Falset���showt���hdrlinkt���levelt���pret���hprefixt ���nested_dlt ���simplelistt���toct���header(���t���selfR���(����(����s$���/usr/lib64/python2.7/idlelib/help.pyR���4���s���� i���c���������C���s>���|��j��|�7_��|��j��d�k�r$�d�n�d�t�|��j����|��_�d��S(���Ni����R���t���l(���R���t���strR���(���R���t���amt(����(����s$���/usr/lib64/python2.7/idlelib/help.pyt���indentC���s����c���������C���s���d�}�x)�|�D]!�\�}�}�|�d�k�r �|�}�q �q �Wd�}�|�d�k�r\�|�d�k�r\�t��|��_�nD|�d�k�r��|�d�k�r��t�|��_�n |�d�k�r��|�d�k�r��d�}�n�|�d �k�r��|�d �k�r��d �|��_�n�|�d �k�r��|�d�k�r��d�|��_�n�|�d�k�rd�|��_�n�|�d!�k�rJ|�j�d���d�k�r4d�}�t��|��_�n �t�|��_�|��j����nV|�d�k�rt|��j�d�k�r�t��|��_�q�n,|�d�k�r�|��j�r�d�n�d�}�n|�d�k�r�|��j�s�d�n�d�}�t�|��_�n��|�d�k�r�|��j����d�}�n��|�d �k�r$t��|��_ �|��j�r|��j �j�d�d���n��d�|��_�n|�|�d�k�rH|�d�k�rHt��|��_ �nX�|�d�k�r`|�|��_�n@�|�d"�k�r�|��j�r�d�|��_�|��j �j�d�d���n��|�|��_�n��|��j�r�|��j �j�d�|�|��j�|��j�f���n��d �S(#���s���Handle starttags in help.html.R���t���classt���divt���sectiont ���sphinxsidebart���pt���firsts��� t���spanR���t���versionmodifiedt���emt���ult���olt���simplei����s��� t���dli����t���lis��� * s��� * t���dtt���ddt���endt���preblockt���at ���headerlinkt���h1t���h2t���h3N(���R-���R.���(���R9���R:���(���t���TrueR���R���R���t���findR���R#���R���R���R���R���t���insertR���R���R���(���R���t���tagt���attrst���class_R6���t���vt���s(����(����s$���/usr/lib64/python2.7/idlelib/help.pyt���handle_starttagG���sd���� c���������C���s����|�d�k�rM�|��j��d���|��j�r��|��j�j�|��j�|��j�j�d���f���q��np�|�d�k�re�d�|��_�nX�|�d �k�r}�t�|��_ �n@�|�d �k�r��t�|��_ �d�|��_�n�|�d�k�r��|��j��d�d���n��d�S(���s���Handle endtags in help.html.R8���R9���R:���i����R=���R*���R,���R���R6���R���R-���R3���R.���R"���i����N(���R8���R9���R:���(���R*���R,���(���R-���R3���R.���(���R#���R���R���t���appendR���R���t���indexR���R���R���R���R���(���R���R>���(����(����s$���/usr/lib64/python2.7/idlelib/help.pyt ���handle_endtag}���s���� + c���������C���s����|��j��r��|��j�r��|��j�r"�|�n�|�j�d�d���}�|��j�d�k�r_�|�d�|�j�d���!|��_�n��|��j�d �k�r��|��j�d�k�r��|�d�t�|��j���!|��j�k�r��|�t�|��j���j����}�n��|��j �|�7_ �n��|��j �j�d�|�|��j�|��j�f���n��d �S(���s"���Handle date segments in help.html.s��� t��� R8���i����R9���R:���R���R4���N(���R8���R9���R:���( ���R���R���R���t���replaceR���RE���R���t���lent���stripR���R���R=���R���(���R���t���datat���d(����(����s$���/usr/lib64/python2.7/idlelib/help.pyt���handle_data����s����!c���������C���s/���|��j��r+�|��j�j�d�t�t�|�������n��d��S(���NR4���(���R���R���R=���t���unichrt���int(���R���t���name(����(����s$���/usr/lib64/python2.7/idlelib/help.pyt���handle_charref����s���� ( ���t���__name__t ���__module__t���__doc__R���R#���RC���RF���RM���RQ���(����(����(����s$���/usr/lib64/python2.7/idlelib/help.pyR���+���s��� 6 t���HelpTextc�����������B���s ���e��Z�d��Z�d����Z�d����Z�RS(���s���Display help.html.c��� ������C���s6��t��j�d�d�d�d�d��}�t��j�d�d�d�d�d��}�d�|�d�}�t�j�|��|�d �d �d�d�d �d�d�d�d�|�d�|��|��j�d�d�d�g���}�|��j�d�d�d�g���}�|�d�f�|��d�<|��j�d�d�|�d�d�f��|��j�d�d�|�d�d�f��|��j�d�d�|�d�d�f��|��j�d�d�|�d �d�f��|��j�d!�d�|�d�f�d"�d#��|��j�d$�d�|�d%�f�d&�d'�d�d(�d)�d*�d"�d+��|��j�d,�d&�d'�d-�d'��|��j�d.�d&�d/�d-�d/��|��j�d0�d&�d1�d-�d1��|��j�d2�d&�d3�d-�d3��t�|����|��_�t�|�����}�|�j ����j �d4�d5���}�Wd6�QX|��j�j�|���d7�|��d8�<d6�S(9���s'���Configure tags and feed file to parser.t���maint���EditorWindowt���widtht���typeRO���t���heighti���i���t���wrapt���wordt���highlightthicknessi����t���padxi���t���borderwidtht ���TkDefaultFontt���arialt ���helveticat���TkFixedFontt���monacot���courieri���t���fontR,���t���italicR8���i���t���boldR9���i���R:���i���R���t ���backgrounds���#f6f6ffR5���i ���t���lmargin1i���i���t���relieft���solids���#eeffcct���l1t���lmargin2t���l2i2���t���l3iK���t���l4id���t���encodings���utf-8Nt���disabledt���state(���R���t ���GetOptionR ���R���t���findfontt ���tag_configureR���t���parsert���opent���readt���decodet���feed( ���R���t���parentt���filenamet���uwidet���uhight ���normalfontt ���fixedfontt���ft���contents(����(����s$���/usr/lib64/python2.7/idlelib/help.pyR�������s0����c���������C���s����x��|�D]��}�|�j�����d����t�j�d�|����D��k�ra�t�j�d�|�d�t�d�|����}�|�j����d�S|�j�����d����t�j�d�|����D��k�r�|�Sq�Wd�S(���s4���Return name of first font family derived from names.c���������s���s���|��]�}�|�j�����Vq�d��S(���N(���t���lower(���t���.0t���x(����(����s$���/usr/lib64/python2.7/idlelib/help.pys ���<genexpr>����s����t���rootRP���t���existst���familyc���������s���s���|��]�}�|�j�����Vq�d��S(���N(���R����(���R����R����(����(����s$���/usr/lib64/python2.7/idlelib/help.pys ���<genexpr>����s���N(���R����t���tkfontt���namest���FontR;���t���actualt���families(���R���R����RP���Rf���(����(����s$���/usr/lib64/python2.7/idlelib/help.pyRv�������s���� ((���RR���RS���RT���R���Rv���(����(����(����s$���/usr/lib64/python2.7/idlelib/help.pyRU�������s��� t ���HelpFramec�����������B���s ���e��Z�d��Z�d����Z�d����Z�RS(���s&���Display html text, scrollbar, and toc.c���������C���s����t��j�|��|���t�|��|���}�|�d�|��d�<t�|��d�|�j��}�|�j�|�d�<|��j�d�d�d��|��j�d�d�d��|��j�|���j �d�d�d�d�d �d ���|�j �d�d�d�d�d �d���|�j �d�d�d�d�d �d ���d��S(���NRi���t���commandt���yscrollcommandi����t���weighti���t���columnt���rowt���stickyt���nwt���nsewi���t���ns( ���R ���R���RU���R���t���yviewt���sett���rowconfiguret���columnconfiguret���toc_menut���grid(���R���R}���R~���R���t���scroll(����(����s$���/usr/lib64/python2.7/idlelib/help.pyR�������s���� %c������������sq���t��|��d�d��}�t�|�d�t��}�x<����j�j�D].�\�}�}�|�j�d�|�d�|����f�d�����q1�W|�|�d�<|�S(���s+���Create table of contents as drop-down menu.R���t���TOCt���tearofft���labelR����c������������s ������j��|����S(���N(���R����(���t���dex(���R���(����s$���/usr/lib64/python2.7/idlelib/help.pyt���<lambda>����R���t���menu(���R ���R���R���Rx���R���t���add_command(���R���R���R���t���dropt���lblR����(����(���R���s$���/usr/lib64/python2.7/idlelib/help.pyR��������s����& (���RR���RS���RT���R���R����(����(����(����s$���/usr/lib64/python2.7/idlelib/help.pyR��������s��� t ���HelpWindowc�����������B���s���e��Z�d��Z�d����Z�RS(���s!���Display frame with rendered html.c���������C���s���t��j�|��|���|��j�|���|��j�d�|��j���t�|��|���j�d�d�d�d�d�d���|��j�d�d�d��|��j�d�d�d��d��S( ���Nt���WM_DELETE_WINDOWR����i����R����R����R����R����i���( ���R���R���t���wm_titlet���protocolt���destroyR����R����t���grid_columnconfiguret���grid_rowconfigure(���R���R}���R~���t���title(����(����s$���/usr/lib64/python2.7/idlelib/help.pyR�������s���� %(���RR���RS���RT���R���(����(����(����s$���/usr/lib64/python2.7/idlelib/help.pyR��������s���c����������C���s����t��t�t�t�t�t���������d�d�d�d�d���}��t��t�t�t�����d���}�t�|��d����G�}�t�|�d����/�}�x%�|�D]�}�|�j�|�j����d ���qy�WWd �QXWd �QXd�GHd �S(���s_��Copy idle.html to idlelib/help.html, stripping trailing whitespace. Files with trailing whitespace cannot be pushed to the hg cpython repository. For 3.x (on Windows), help.html is generated, after editing idle.rst in the earliest maintenance version, with sphinx-build -bhtml . build/html python_d.exe -c "from idlelib.help import copy_strip; copy_strip()" After refreshing TortoiseHG workshop to generate a diff, check both the diff and displayed text. Push the diff along with the idle.rst change and merge both into default (or an intermediate maintenance version). When the 'earlist' version gets its final maintenance release, do an update as described above, without editing idle.rst, to rebase help.html on the next version of idle.rst. Do not worry about version changes as version is not displayed. Examine other changes and the result of Help -> IDLE Help. If maintenance and default versions of idle.rst diverge, and merging does not go smoothly, then consider generating separate help.html files from separate idle.htmls. t���Doct���buildt���htmlt���librarys ���idle.htmls ���help.htmlt���rt���ws��� Ns���idle.html copied to help.html(���R���R���R���t���__file__Ry���t���writet���rstrip(���t���srct���dstt���innt���outt���line(����(����s$���/usr/lib64/python2.7/idlelib/help.pyt ���copy_strip����s���� 'c���������C���sF���t��t�t�t�����d���}�t�|���s+�d�St�|��|�d�t������d�S(���s7���Create HelpWindow; called from Idle Help event handler.s ���help.htmlNs���IDLE Help (%s)(���R���R���R���R����R���R����R���(���R}���R~���(����(����s$���/usr/lib64/python2.7/idlelib/help.pyt ���show_idlehelp��s����t���__main__(���t���run("���RT���R����t���os.pathR���R���R���R���R���t���platformR���t���TkinterR���R���R ���R ���R���R���R ���t���tkFontR����t���idlelib.configHandlerR���R���t���use_ttkt���tkinter.ttkR���RU���R����R����R����R����RR���t���idlelib.idle_test.htestR����(����(����(����s$���/usr/lib64/python2.7/idlelib/help.pyt���<module>���s$���(4s*