3
(h5                 @   s  d ddddZ G dd deZG dd dZe Zejed dd	d
 ejedddd ejedddd
 ejedddd
 ejedddd ejedddd
 ejedddd
 ejedddd
 ejedddd
 ejed d!d"d
 ejed#d$d%d
 ejed&d'd(d
 ejed)d*d+d
 ejed,d-d.d ejed/dd0d ejed1d2d3d
 ejed4d5d6d
 ejed7d8d9d
 ejed:d;d<d ejed=dd>d ejed?d@dAd
 ejedBd-dCd ejedDdEdFd
 ejedGdHdId
 ejedJdKdLd
 ejedMddNd ejedOdPdQd
 ejedRdSdTd ejedUdVdWd
 ejedXddYd ejedZd[d\d
 ejed]d^d_d
 ejed`dKdad ejedbdcddd
 ejededfdgd
 ejedhdidjd
 ejedkdldmd
 ejedndodpd
 ejedqdrdsd
 ejedtd;dud
 ejedvd;dwd ejedxdldyd ejedzdKd{d ejed|d}d~d
 ejedd}dd ejedddd ejedddd ejedddd ejedd-dd ejedd-dd
 ejedd-dd ejeddodd ejedddd
 ejedddd ejedddd
 ejeddSdd ejeddSdd
 ejedddd
 ejedddd ejedddd
 ejedd[dd ejedd$dd ejeddKdd ejedddd ejeddfdd ejedddd ejeddHdd ejedd2dd ejedddd ejeddidd ejedddd ejedd@dd ejedddd ejeddVdd ejedd;dd ejedddd ejeddrdd ejedd!dd ejedd^dd ejedddd ejedd8dd ejeddEdd ejeddPdd ejedd*dd ejedd5dd ejeddcdd ejedd'dd ejedddd
 ejedddd ejedddd ejedddd
 ejedddd ejedddd
 ejedddd ejeddKdd ejedddd ejedddd ejedddd ejedddd ejedddd ejedddd ejedddd ejedddd ejedddd ejedddd ejeddd d ejedddd ejedddd ejedddd ejedddd ejed	dd
d ejedddd ejedddd ejedddd ejedddd ejeddcdd ejeddcdd ejeddcdd ejeddcdd ejeddcdd ejeddcdd ejeddcd d ejed!dcd"d ejed#dcd$d ejed%dcd&d ejed'dcd(d ejed)dcd*d ejed+dcd,d ejed-dcd.d ejed/dcd0d ejed1dcd2d ejed3dcd4d ejed5dcd6d ejed7dcd8d ejed9dcd:d ejed;dcd<d ejed=dd>d ejed?dd@d ejedAddBd ejedCddDd ejedEddFd ejedGddHd ejedIddJd ejedKddLd ejedMddNd ejedOddPd ejedQddRd ejedSddTd ejedUddVd ejedWddXd ejedYddZd ejed[dd\d ejed]dd^d ejed_dd`d ejedaddbd ejedcdddd ejeded^dfd ejedgd^dhd ejedid^djd ejedkd^dld ejedmd^dnd ejedod^dpd ejedqd^drd ejedsd^dtd ejedud^dvd ejedwd^dxd ejedyd^dzd ejed{d^d|d ejed}d^d~d ejedd^dd ejedd^dd ejedd^dd ejedd^dd ejedd^dd ejedd^dd ejedd^dd ejedd^dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejedd}dd ejZejZ	dd Z
dS (           )   !   X   [   c               @   s4   e Zd Zdd Zdd Zedd Zedd Zd	S )
Charsetc             C   s$   |||  | _ | _| _|dk| _d S )NYes)idname	collation
is_default)selfr
   r   r   r    r   4/tmp/pip-install-q3hcpn_q/PyMySQL/pymysql/charset.py__init__
   s    zCharset.__init__c             C   s   d| j | j| jf S )Nz%Charset(id=%s, name=%r, collation=%r))r
   r   r   )r   r   r   r   __repr__   s    zCharset.__repr__c             C   s   | j }|dkrdS |S )Nutf8mb4utf8)r   )r   r   r   r   r   encoding   s    zCharset.encodingc             C   s
   | j dkS )N?   )r
   )r   r   r   r   	is_binary   s    zCharset.is_binaryN)__name__
__module____qualname__r   r   propertyr   r   r   r   r   r   r   	   s   r   c               @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
Charsetsc             C   s
   i | _ d S )N)_by_id)r   r   r   r   r      s    zCharsets.__init__c             C   s   || j |j< d S )N)r   r
   )r   cr   r   r   add"   s    zCharsets.addc             C   s
   | j | S )N)r   )r   r
   r   r   r   by_id%   s    zCharsets.by_idc             C   s4   |j  }x&| jj D ]}|j|kr|jr|S qW d S )N)lowerr   valuesr   r   )r   r   r   r   r   r   by_name(   s    zCharsets.by_nameN)r   r   r   r   r   r    r#   r   r   r   r   r      s   r   big5Zbig5_chinese_cir	   latin2Zlatin2_czech_cs Zdec8Zdec8_swedish_ci   cp850Zcp850_general_ci   latin1Zlatin1_german1_ci   Zhp8Zhp8_english_ci   Zkoi8rZkoi8r_general_cir   Zlatin1_swedish_ci	   Zlatin2_general_ci
   Zswe7Zswe7_swedish_ci   asciiZascii_general_ci   ujisZujis_japanese_ci   sjisZsjis_japanese_ci   cp1251Zcp1251_bulgarian_ci   Zlatin1_danish_ci   hebrewZhebrew_general_ci   tis620Ztis620_thai_ci   euckrZeuckr_korean_ci   latin7Zlatin7_estonian_cs   Zlatin2_hungarian_ci   Zkoi8uZkoi8u_general_ci   Zcp1251_ukrainian_ci   gb2312Zgb2312_chinese_ci   greekZgreek_general_ci   cp1250Zcp1250_general_ci   Zlatin2_croatian_ci   gbkZgbk_chinese_ci   cp1257Zcp1257_lithuanian_ci   latin5Zlatin5_turkish_ci   Zlatin1_german2_ci    Zarmscii8Zarmscii8_general_cir   r   Zutf8_general_ci"   Zcp1250_czech_cs#   Zucs2Zucs2_general_ci$   cp866Zcp866_general_ci%   Zkeybcs2Zkeybcs2_general_ci&   ZmacceZmacce_general_ci'   macromanZmacroman_general_ci(   cp852Zcp852_general_ci)   Zlatin7_general_ci*   Zlatin7_general_cs+   Z	macce_bin,   Zcp1250_croatian_ci-   r   Zutf8mb4_general_ci.   Zutf8mb4_bin/   Z
latin1_bin0   Zlatin1_general_ci1   Zlatin1_general_cs2   Z
cp1251_bin3   Zcp1251_general_ci4   Zcp1251_general_cs5   Zmacroman_bin6   utf16Zutf16_general_ci7   Z	utf16_bin9   cp1256Zcp1256_general_ci:   Z
cp1257_bin;   Zcp1257_general_ci<   utf32Zutf32_general_ci=   Z	utf32_binr   binary@   Zarmscii8_binA   Z	ascii_binB   Z
cp1250_binC   Z
cp1256_binD   Z	cp866_binE   Zdec8_binF   Z	greek_binG   Z
hebrew_binH   Zhp8_binI   Zkeybcs2_binJ   Z	koi8r_binK   Z	koi8u_binM   Z
latin2_binN   Z
latin5_binO   Z
latin7_binP   Z	cp850_binQ   Z	cp852_binR   Zswe7_binS   Zutf8_binT   Zbig5_binU   Z	euckr_binV   Z
gb2312_binW   Zgbk_binr   Zsjis_binY   Z
tis620_binZ   Zucs2_binr   Zujis_bin\   Zgeostd8Zgeostd8_general_ci]   Zgeostd8_bin^   Zlatin1_spanish_ci_   cp932Zcp932_japanese_ci`   Z	cp932_bina   ZeucjpmsZeucjpms_japanese_cib   Zeucjpms_binc   Zcp1250_polish_cie   Zutf16_unicode_cif   Zutf16_icelandic_cig   Zutf16_latvian_cih   Zutf16_romanian_cii   Zutf16_slovenian_cij   Zutf16_polish_cik   Zutf16_estonian_cil   Zutf16_spanish_cim   Zutf16_swedish_cin   Zutf16_turkish_cio   Zutf16_czech_cip   Zutf16_danish_ciq   Zutf16_lithuanian_cir   Zutf16_slovak_cis   Zutf16_spanish2_cit   Zutf16_roman_ciu   Zutf16_persian_civ   Zutf16_esperanto_ciw   Zutf16_hungarian_cix   Zutf16_sinhala_ci   Zucs2_unicode_ci   Zucs2_icelandic_ci   Zucs2_latvian_ci   Zucs2_romanian_ci   Zucs2_slovenian_ci   Zucs2_polish_ci   Zucs2_estonian_ci   Zucs2_spanish_ci   Zucs2_swedish_ci   Zucs2_turkish_ci   Zucs2_czech_ci   Zucs2_danish_ci   Zucs2_lithuanian_ci   Zucs2_slovak_ci   Zucs2_spanish2_ci   Zucs2_roman_ci   Zucs2_persian_ci   Zucs2_esperanto_ci   Zucs2_hungarian_ci   Zucs2_sinhala_ci   Zucs2_general_mysql500_ci   Zutf32_unicode_ci   Zutf32_icelandic_ci   Zutf32_latvian_ci   Zutf32_romanian_ci   Zutf32_slovenian_ci   Zutf32_polish_ci   Zutf32_estonian_ci   Zutf32_spanish_ci   Zutf32_swedish_ci   Zutf32_turkish_ci   Zutf32_czech_ci   Zutf32_danish_ci   Zutf32_lithuanian_ci   Zutf32_slovak_ci   Zutf32_spanish2_ci   Zutf32_roman_ci   Zutf32_persian_ci   Zutf32_esperanto_ci   Zutf32_hungarian_ci   Zutf32_sinhala_ci   Zutf8_unicode_ci   Zutf8_icelandic_ci   Zutf8_latvian_ci   Zutf8_romanian_ci   Zutf8_slovenian_ci   Zutf8_polish_ci   Zutf8_estonian_ci   Zutf8_spanish_ci   Zutf8_swedish_ci   Zutf8_turkish_ci   Zutf8_czech_ci   Zutf8_danish_ci   Zutf8_lithuanian_ci   Zutf8_slovak_ci   Zutf8_spanish2_ci   Zutf8_roman_ci   Zutf8_persian_ci   Zutf8_esperanto_ci   Zutf8_hungarian_ci   Zutf8_sinhala_ci   Zutf8_general_mysql500_ci   Zutf8mb4_unicode_ci   Zutf8mb4_icelandic_ci   Zutf8mb4_latvian_ci   Zutf8mb4_romanian_ci   Zutf8mb4_slovenian_ci   Zutf8mb4_polish_ci   Zutf8mb4_estonian_ci   Zutf8mb4_spanish_ci   Zutf8mb4_swedish_ci   Zutf8mb4_turkish_ci   Zutf8mb4_czech_ci   Zutf8mb4_danish_ci   Zutf8mb4_lithuanian_ci   Zutf8mb4_slovak_ci   Zutf8mb4_spanish2_ci   Zutf8mb4_roman_ci   Zutf8mb4_persian_ci   Zutf8mb4_esperanto_ci   Zutf8mb4_hungarian_ci   Zutf8mb4_sinhala_ci   Zutf8mb4_german2_ci   Zutf8mb4_croatian_ci   Zutf8mb4_unicode_520_ci   Zutf8mb4_vietnamese_cic             C   s   | dkrdS | S )z3Convert MySQL's charset name to Python's codec namer   r   r   )r   r   r   r   charset_to_encoding
  s    r   N)ZMBLENGTHobjectr   r   Z	_charsetsr   r#   Zcharset_by_namer    Zcharset_by_idr   r   r   r   r   <module>   s  