Plan 9 from Bell Labs’s /usr/web/sources/contrib/bichued/root/sys/lib/python/encodings/__init__.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�
��c@s�dZddkZddkZddklZhZdZdgZdZeiZ	de
efd��YZd	�Z
d
�Zeie�dS(s, Standard "encodings" Package

    Standard Python encoding modules are stored in this package
    directory.

    Codec modules must have names corresponding to normalized encoding
    names as defined in the normalize_encoding() function below, e.g.
    'utf-8' must be implemented by the module 'utf_8.py'.

    Each codec module must export the following interface:

    * getregentry() -> codecs.CodecInfo object
    The getregentry() API must a CodecInfo object with encoder, decoder,
    incrementalencoder, incrementaldecoder, streamwriter and streamreader
    atttributes which adhere to the Python Codec Interface Standard.

    In addition, a module may optionally also define the following
    APIs which are then used by the package's codec search function:

    * getaliases() -> sequence of encoding name strings to use as aliases

    Alias names returned by getaliases() must be normalized encoding
    names as defined by normalize_encoding().

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

i�N(taliasess--unknown--t*s                                              . 0123456789       ABCDEFGHIJKLMNOPQRSTUVWXYZ      abcdefghijklmnopqrstuvwxyz                                                                                                                                     tCodecRegistryErrorcBseZRS((t__name__t
__module__(((s%/sys/lib/python/encodings/__init__.pyR-scCsEt|�tijo|id�}ndi|it�i��S(s� Normalize an encoding name.

        Normalization works as follows: all non-alphanumeric
        characters except the dot used for Python package names are
        collapsed and replaced with a single underscore, e.g. '  -;#'
        becomes '_'. Leading and trailing underscores are removed.

        Note that encoding names should be ASCII only; if they do use
        non-ASCII characters, these must be Latin-1 compatible.

    slatin-1t_(ttypettypestUnicodeTypetencodetjoint	translatet_norm_encoding_maptsplit(tencoding((s%/sys/lib/python/encodings/__init__.pytnormalize_encoding0sc
CsYti|t�}|tj	o|Snt|�}ti|�pti|idd��}|dj	o||g}n
|g}xj|D]\}|p
d|joq�ny#td|t�t	�t
�}Wntj
oq�XPq�Wd}y
|i}Wnt
j
o
d}nX|djodt|<dSn|�}t|ti�p�dt|�jo
djnptd|i|if�nt|d�p�t|d�p�|d	dj	ot|d	�p�|d
dj	ot|d
�plt|�djo#|ddj	ot|d�p6t|�djo@|ddj	o/t|d�otd|i|if�nt|�djp|d
djo6|dd
t|�|iidd�df7}nti|�}n|t|<y|i�}Wnt
j
on1Xx,|D]$}	ti|	�p|t|	<q-q-W|S(Nt.Rs
encodings.iis#module "%s" (%s) failed to registeriiiiis'incompatible codecs in module "%s" (%s)i(N(t_cachetgett_unknownRt_aliasestreplacetNonet
__import__tglobalstlocalst_import_tailtImportErrortgetregentrytAttributeErrort
isinstancetcodecst	CodecInfotlenRRt__file__tcallableR
t
getaliasesthas_key(
Rtentryt
norm_encodingtaliased_encodingtmodnamestmodnametmodRtcodecaliasestalias((s%/sys/lib/python/encodings/__init__.pytsearch_functionFsp
	

	



	$##66$6
(t__doc__RRt	encodingsRRRRRRtLookupErrortSystemErrorRRR.tregister(((s%/sys/lib/python/encodings/__init__.pys<module>s				T

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.