관리-도구
편집 파일: iomenu.cpython-37.opt-1.pyc
B � f�P � @ s� d dl Z d dl mZ d dlZd dlZd dlZd dlZd dlZd dlmZ d dl mZ d dl mZ d dlZd dlmZ ejr�dZdZn�yd dlZe�ejd� W n eejfk r� Y nX ejdkr�dZdZn�ye�ej�Zer�e �e� W nX ee e!fk �rD y e�"� d Ze�r"e �e� W n e#e!fk �r> Y nX Y nX e�rZe�$� Zd ZndZdZe�%dej&�Z'e�%d ej&�Z(dd� Z)G dd� d�Z*dd� Z+e,dk�r�d dl-m.Z. e.dddd� d dl/m0Z0 e0e+� dS )� N)�BOM_UTF8)� askstring)�idleConfzutf-8�surrogateescape� Zwin32� �strict�asciiz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)z^[ \t\f]*(?:[#\r\n]|$)c C s� t | t�r| �d�}n| }d|kr8|�dd�dd� }n$d|krV|�dd�dd� }n|g}x2|D ]&}t�|�}|dk rzP t�|�sbdS qbW dS |�d�}yt� |� W n t k r� t d| ��Y nX |S )aV Return the encoding declaration according to PEP 263. When checking encoded data, only the first two lines should be passed in to avoid a UnicodeDecodeError if the rest of the data is not unicode. The first two lines would contain the encoding specification. Raise a LookupError if the encoding is declared but unknown. z iso-8859-1� � N� r zUnknown encoding: )� isinstance�bytes�decode�split� coding_re�match�blank_re�group�codecs�lookup�LookupError)�data�linesZlst�liner �name� r �3/opt/alt/python37/lib64/python3.7/idlelib/iomenu.py�coding_specB s* r c @ s� e Zd Zdd� Zdd� Zdd� Zdd� Zd d � ZdZdd � Z dZ dZdd� Zd4dd�Z dZe�e�ZejZdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� ZdZdZ d'Z!e"j#d(kr�d)nd*Z$d+d,� Z%d5d.d/�Z&d0d1� Z'd2d3� Z(dS )6� IOBindingc C sr || _ |j| _| j�d| j�| _| j�d| j�| _| j�d| j�| _| j�d| j �| _ d | _| j�d| j�| _ d S )Nz<<open-window-from-file>>z<<save-window>>z<<save-window-as-file>>z<<save-copy-of-window-as-file>>z<<print-window>>)�editwin�text�bind�open�_IOBinding__id_open�save�_IOBinding__id_save�save_as�_IOBinding__id_saveas�save_a_copy�_IOBinding__id_savecopy�fileencoding�print_window�_IOBinding__id_print)�selfr r r r �__init__p s zIOBinding.__init__c C sf | j �d| j� | j �d| j� | j �d| j� | j �d| j� | j �d| j� d | _d | _ d | _d S )Nz<<open-window-from-file>>z<<save-window>>z<<save-window-as-file>>z<<save-copy-of-window-as-file>>z<<print-window>>) r! Zunbindr$ r&