Hacked By AnonymousFox
B
� f5 � @ s� d Z ddlZddlZddlZddlmZ ddlmZ dd� Z dd� Z
G d d
� d
�ZG dd� de�ZG d
d� de�Z
dd� Zedkr�ddlmZ edddd� ddlmZ ee� dS )z�Line numbering implementation for IDLE as an extension.
Includes BaseSideBar which can be extended for other sidebar based extensions
� N)�idleConf)� Delegatorc C s t t| �d���S )z:Utility to get the last line's number in a Tk text widget.zend-1c)�int�float�index)�text� r �4/opt/alt/python37/lib64/python3.7/idlelib/sidebar.py�get_end_linenumber s r
c C s� | � � }|dkr| �� }n |dkr,| �� }ntd|� ���tt| jj|d | �d�| �d�g��}tt| jj|d | �d�| �d�g��}||fS )z;Get the total padding of a Tk widget, including its border.�pack�gridzUnsupported geometry manager: �padxZborder�pady) Z
winfo_managerZ pack_infoZ grid_info�
ValueError�sum�map�tkZgetintZcget)ZwidgetZmanager�infor
r r r r �get_widget_padding s
r c @ sh e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dd� Z
dd� Zdd� Zdd� Z
dd� ZdS )�BaseSideBarz@
The base class for extensions which require a sidebar.
c C sx || _ |j| _|j| _t| j�\}}tj| jdtjd|ddd�| _| jj tj
d� | j| jd<