|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21585/root/usr/lib64/python2.4/encodings/ |
Upload File : |
mò
‚=5Dc @ s d Z d k Z d k Z d k Z d k Z h Z d Z d g Z d Z e i Z d e i
e i f d „ ƒ YZ d „ Z
d „ Z e i e ƒ d S( 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() -> (encoder, decoder, stream_reader, stream_writer)
The getregentry() API must return callable objects 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.
Ns --unknown--t *s . 0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz t CodecRegistryErrorc B s t Z RS( N( t __name__t
__module__( ( ( t* /usr/lib64/python2.4/encodings/__init__.pyR + s c C sE t | ƒ t i j o | i d ƒ } n d i | i t ƒ 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.
s latin-1t _N( t typet encodingt typest UnicodeTypet encodet joint translatet _norm_encoding_mapt split( R ( ( R t normalize_encoding/ s c C s t i | t ƒ }
|
t j o |
Sn t | ƒ } t i | ƒ p t i | i d d ƒ ƒ } | d j o | | g } n
| g } xX | D]J } | p q‹ n y t
| t ƒ t ƒ t ƒ } Wn t j
o q‹ XPq‹ Wd } y
| i } Wn t j
o
d } n X| d j o d t | <d Sn t | ƒ ƒ }
t |
ƒ d j o t d | i | i f ‚ n x8 |
D]0 } t | ƒ p t d | i | i f ‚ qmqmW|
t | <y | i ƒ } Wn t j
o n1 Xx, | D]$ } t i | ƒ p | t | <qØqØW|
S( Nt .R i s# module "%s" (%s) failed to registers' incompatible codecs in module "%s" (%s)( t _cachet getR t _unknownt entryR t
norm_encodingt _aliasest replacet aliased_encodingt Nonet modnamest modnamet
__import__t globalst localst _import_tailt modt ImportErrort getregentryt AttributeErrort tuplet lenR R t __file__t objt callablet
getaliasest codecaliasest aliast has_key( R R R"