ok
Direktori : /opt/alt/python36/lib64/python3.6/idlelib/__pycache__/ |
Current File : //opt/alt/python36/lib64/python3.6/idlelib/__pycache__/help.cpython-36.opt-1.pyc |
3 *j�a=, � @ s� d Z ddlmZ ddlmZmZmZmZ ddlm Z ddl mZmZm Z mZ ddlmZmZ ddl mZ ddlmZ G d d � d e�ZG dd� de �ZG d d� de�ZG dd� de�Zdd� Zdd� Zedkr�ddlmZ edddd� ddlm Z e e� dS )a 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 help_about.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. � )� HTMLParser)�abspath�dirname�isfile�join)�python_version)�Toplevel�Frame�Text�Menu)� Menubutton� Scrollbar)�font)�idleConfc @ s: e Zd ZdZdd� Zddd�Zdd� Zd d � Zdd� Zd S )� HelpParsera~ 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 sZ t j| dd� || _d| _d| _d| _d| _d| _d| _d| _ d| _ d| _g | _d| _ d S )NT)Zconvert_charrefs� Fr )r �__init__�text�tags�chartags�show�hdrlink�level�pre�hprefix� nested_dl� simplelist�toc�header)�selfr � r �1/opt/alt/python36/lib64/python3.6/idlelib/help.pyr 3 s zHelpParser.__init__� c C s0 | j |7 _ | j dkrdndt| j � | _d S )Nr r �l)r �strr )r �amtr r r! �indentB s zHelpParser.indentc C s d}x|D ]\}}|dkr |}q W d}|dkr@|dkr@d| _ �n�|dkrZ|dkrZd| _ �n�|dkrr|d krrd }�nv|dkr�|dkr�d| _�n\|dkr�|d kr�d| _�nB|dkr�d| _�n0|d#kr�|jd�d$kr�d}d| _nd| _| j� � n�|dk�r | jdk�r�d| _n�|dk�r&| j�r dnd}n�|dk�rH| j�s<d nd}d| _n�|dk�r`| j� d}n�|dk�r�d| _| j �r�| jj dd � d| _ nZ|dk�r�|dk�r�d| _n>|dk�r�|| _ n,|d%k�r�| j �r�d| _| jj dd � || _ | j �r| jj d|| j | jf� d"S )&zHandle starttags in help.html.r �classZdivZsectionTZ sphinxsidebarF�p�firstz �spanr Zversionmodified�em�ul�olZsimpler"