3 fP @ s d dl Z d dl mZ d dlZd dlZd dlZd dlZd dlZd dljZ d dl jZd dl mZ d dlZd dlmZ ejr~dZn yd dlZejejd W n eejfk r Y nX dZejdkryej d Ze je W n ek r Y nX ny2ejej ZedksedkrdZe je W nj e!e"efk r y2ej d Zedks`edkrddZe je W n e#efk r Y nX Y nX ej$ ZeZej%d ej&Z'ej%dej&Z(dd Z)G dd dZ*dd Z+e,dkrd dl-m.Z. e.dddd d dl/m0Z0 e0e+ dS ) N)BOM_UTF8) askstring)idleConfzutf-8 asciiZwin32 z&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)z^[ \t\f]*(?:[#\r\n]|$)c C s t | tr| jd}n| }d|kr8|jdddd }n$d|krV|jdddd }n|g}x2|D ]&}tj|}|dk rzP tj|sbdS qbW dS |jd}ytj | 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: ) isinstancebytesdecodesplit coding_rematchblank_regroupcodecslookupLookupError)datalinesZlstliner name r 3/opt/alt/python36/lib64/python3.6/idlelib/iomenu.pycoding_specG s* r c @ s e Zd Zdd Zdd Zdd Zdd Zd d ZdZdd Z dZ dZdd Zd:ddZ dZejeZejZdd Zdd Zdd Zdd Zdd Zdd Zdd Zd!d" Zd#d$ Zd%d&