Your IP : 216.73.216.213
B
�d{T}C � @ s� d Z dZddlZddlZddlmZ ddlmZ ddl m
Z yddlm
Z
W n ek
rd dZ
Y nX ddlmZ d d
ddd
dddddddddd�Zdddd�Zdd� Ze�d�Ze�d�Zded d!�Zdfd"d#�Zdgd$d%�Zd&d'� Zdhd)d*�Zed+�e�Zd,d-� Zd.d/� Zd0Ze�e�Z d1Z!d2Z"e�d3e!e"f �Z#e�d4e!e"e!f �Z$d5d6d7d8d9d:�Z%d;d5d<d=d>d?�Z&de'e e#fd@dA�Z(e�dB�Z)didDdE�Z*dFZ+dGZ,dHZ-dIdJdKdLdMdNdOdP�Z.dIdQdRdSdTdUdVdWdXdY� Z/djdZd[�Z0dkd\d]�Z1d^d_d`da�Z2ej3e2fdbdc�Z4dS )la Some text manipulation utility functions.
:group text formatting: normalize_text, normalize_paragraph, pretty_match,unquote, colorize_ansi
:group text manipulation: searchall, splitstrip
:sort: text formatting, text manipulation
:type ANSI_STYLES: dict(str)
:var ANSI_STYLES: dictionary mapping style identifier to ANSI terminal code
:type ANSI_COLORS: dict(str)
:var ANSI_COLORS: dictionary mapping color identifier to ANSI terminal code
:type ANSI_PREFIX: str
:var ANSI_PREFIX:
ANSI terminal code notifying the start of an ANSI escape sequence
:type ANSI_END: str
:var ANSI_END:
ANSI terminal code notifying the end of an ANSI escape sequence
:type ANSI_RESET: str
:var ANSI_RESET:
ANSI terminal code resetting format defined by a previous ANSI escape sequence
zrestructuredtext en� N)�warn)� normalize)�linesep�
)�
deprecated�!�l�/ZAEz(c)�"Zaez(r)ZoeZOE�O�o�ss)� ¡u łu ⁄� Æ� ©� «� æ� ®u œu Œ� Ø� ø� »� ßc C s� |dk rt dtdd� |rd}g }xn| dd� D ]^}yt| }W nB tk
r� td|�d }t|�dkr~|dkrztd ��|}Y nX |�|� q0W d�|�S )
aV replace diacritical characters with their corresponding ascii characters
Convert the unicode string to its long normalized form (unicode character
will be transform into several characters) and keep the first one only.
The normal form KD (NFKD) will apply the compatibility decomposition, i.e.
replace all compatibility characters with their equivalents.
:type substitute: str
:param substitute: replacement character to use if decomposition fails
:see: Another project about ASCII transliterations of Unicode text
http://pypi.python.org/pypi/Unidecode
NzDignorenonascii is deprecated, use substitute named parameter instead� )�
stacklevel� ZNFKDr � z*can't deal with non-ascii based characters) r �DeprecationWarning�MANUAL_UNICODE_MAP�KeyError�
_uninormalize�ord�
ValueError�append�join)ZustringZignorenonascii�
substitute�res�letter�replacement� r( �I/opt/alt/python37/lib/python3.7/site-packages/logilab/common/textutils.py�
unormalizeK s"