/opt/alt/python34/lib64/python3.4/__pycache__
NameSizeModeActions
abc.cpython-34.pyc78770644editdlrm
abc.cpython-34.pyo78270644editdlrm
aifc.cpython-34.pyc279120644editdlrm
aifc.cpython-34.pyo279120644editdlrm
antigravity.cpython-34.pyc8470644editdlrm
antigravity.cpython-34.pyo8470644editdlrm
argparse.cpython-34.pyc658740644editdlrm
argparse.cpython-34.pyo657150644editdlrm
ast.cpython-34.pyc123600644editdlrm
ast.cpython-34.pyo123600644editdlrm
asynchat.cpython-34.pyc83590644editdlrm
asynchat.cpython-34.pyo83590644editdlrm
asyncore.cpython-34.pyc179630644editdlrm
asyncore.cpython-34.pyo179630644editdlrm
base64.cpython-34.pyc182970644editdlrm
base64.cpython-34.pyo180990644editdlrm
bdb.cpython-34.pyc186940644editdlrm
bdb.cpython-34.pyo186940644editdlrm
binhex.cpython-34.pyc135410644editdlrm
binhex.cpython-34.pyo135410644editdlrm
bisect.cpython-34.pyc28580644editdlrm
bisect.cpython-34.pyo28580644editdlrm
bz2.cpython-34.pyc151560644editdlrm
bz2.cpython-34.pyo151560644editdlrm
calendar.cpython-34.pyc275670644editdlrm
calendar.cpython-34.pyo275670644editdlrm
cgi.cpython-34.pyc298270644editdlrm
cgi.cpython-34.pyo298270644editdlrm
cgitb.cpython-34.pyc110640644editdlrm
cgitb.cpython-34.pyo110640644editdlrm
chunk.cpython-34.pyc52700644editdlrm
chunk.cpython-34.pyo52700644editdlrm
cmd.cpython-34.pyc134560644editdlrm
cmd.cpython-34.pyo134560644editdlrm
code.cpython-34.pyc97020644editdlrm
code.cpython-34.pyo97020644editdlrm
codecs.cpython-34.pyc351320644editdlrm
codecs.cpython-34.pyo351320644editdlrm
codeop.cpython-34.pyc64660644editdlrm
codeop.cpython-34.pyo64660644editdlrm
colorsys.cpython-34.pyc36590644editdlrm
colorsys.cpython-34.pyo36590644editdlrm
compileall.cpython-34.pyc73780644editdlrm
compileall.cpython-34.pyo73780644editdlrm
configparser.cpython-34.pyc448820644editdlrm
configparser.cpython-34.pyo448820644editdlrm
contextlib.cpython-34.pyc103700644editdlrm
contextlib.cpython-34.pyo103700644editdlrm
copy.cpython-34.pyc80610644editdlrm
copy.cpython-34.pyo79750644editdlrm
copyreg.cpython-34.pyc46070644editdlrm
copyreg.cpython-34.pyo45660644editdlrm
cProfile.cpython-34.pyc46220644editdlrm
cProfile.cpython-34.pyo46220644editdlrm
crypt.cpython-34.pyc24370644editdlrm
crypt.cpython-34.pyo24370644editdlrm
csv.cpython-34.pyc129970644editdlrm
csv.cpython-34.pyo129970644editdlrm
datetime.cpython-34.pyc562640644editdlrm
datetime.cpython-34.pyo542960644editdlrm
decimal.cpython-34.pyc1725260644editdlrm
decimal.cpython-34.pyo1725260644editdlrm
difflib.cpython-34.pyc605150644editdlrm
difflib.cpython-34.pyo604670644editdlrm
dis.cpython-34.pyc145870644editdlrm
dis.cpython-34.pyo145870644editdlrm
doctest.cpython-34.pyc801100644editdlrm
doctest.cpython-34.pyo798370644editdlrm
dummy_threading.cpython-34.pyc12140644editdlrm
dummy_threading.cpython-34.pyo12140644editdlrm
enum.cpython-34.pyc163390644editdlrm
enum.cpython-34.pyo163390644editdlrm
filecmp.cpython-34.pyc91200644editdlrm
filecmp.cpython-34.pyo91200644editdlrm
fileinput.cpython-34.pyc142970644editdlrm
fileinput.cpython-34.pyo142970644editdlrm
fnmatch.cpython-34.pyc31460644editdlrm
fnmatch.cpython-34.pyo31460644editdlrm
formatter.cpython-34.pyc189160644editdlrm
formatter.cpython-34.pyo189160644editdlrm
fractions.cpython-34.pyc192700644editdlrm
fractions.cpython-34.pyo192700644editdlrm
ftplib.cpython-34.pyc333220644editdlrm
ftplib.cpython-34.pyo333220644editdlrm
functools.cpython-34.pyc236140644editdlrm
functools.cpython-34.pyo236140644editdlrm
genericpath.cpython-34.pyc34930644editdlrm
genericpath.cpython-34.pyo34930644editdlrm
getopt.cpython-34.pyc67330644editdlrm
getopt.cpython-34.pyo66910644editdlrm
getpass.cpython-34.pyc46240644editdlrm
getpass.cpython-34.pyo46240644editdlrm
gettext.cpython-34.pyc151740644editdlrm
gettext.cpython-34.pyo151740644editdlrm
glob.cpython-34.pyc28800644editdlrm
glob.cpython-34.pyo28800644editdlrm
gzip.cpython-34.pyc194460644editdlrm
gzip.cpython-34.pyo193920644editdlrm
hashlib.cpython-34.pyc79440644editdlrm
hashlib.cpython-34.pyo79440644editdlrm
heapq.cpython-34.pyc139100644editdlrm
heapq.cpython-34.pyo139100644editdlrm
hmac.cpython-34.pyc51460644editdlrm
hmac.cpython-34.pyo51460644editdlrm
imaplib.cpython-34.pyc434790644editdlrm
imaplib.cpython-34.pyo409550644editdlrm
imghdr.cpython-34.pyc41430644editdlrm
imghdr.cpython-34.pyo41430644editdlrm
imp.cpython-34.pyc98670644editdlrm
imp.cpython-34.pyo98670644editdlrm
inspect.cpython-34.pyc763270644editdlrm
inspect.cpython-34.pyo760060644editdlrm
io.cpython-34.pyc34580644editdlrm
io.cpython-34.pyo34580644editdlrm
ipaddress.cpython-34.pyc629840644editdlrm
ipaddress.cpython-34.pyo629840644editdlrm
keyword.cpython-34.pyc19460644editdlrm
keyword.cpython-34.pyo19460644editdlrm
linecache.cpython-34.pyc31120644editdlrm
linecache.cpython-34.pyo31120644editdlrm
locale.cpython-34.pyc372760644editdlrm
locale.cpython-34.pyo372760644editdlrm
lzma.cpython-34.pyc159170644editdlrm
lzma.cpython-34.pyo159170644editdlrm
macpath.cpython-34.pyc60060644editdlrm
macpath.cpython-34.pyo60060644editdlrm
macurl2path.cpython-34.pyc21020644editdlrm
macurl2path.cpython-34.pyo21020644editdlrm
mailbox.cpython-34.pyc702880644editdlrm
mailbox.cpython-34.pyo701890644editdlrm
mailcap.cpython-34.pyc65440644editdlrm
mailcap.cpython-34.pyo65440644editdlrm
mimetypes.cpython-34.pyc168070644editdlrm
mimetypes.cpython-34.pyo168070644editdlrm
modulefinder.cpython-34.pyc173760644editdlrm
modulefinder.cpython-34.pyo172970644editdlrm
netrc.cpython-34.pyc42770644editdlrm
netrc.cpython-34.pyo42770644editdlrm
nntplib.cpython-34.pyc363100644editdlrm
nntplib.cpython-34.pyo363100644editdlrm
ntpath.cpython-34.pyc133050644editdlrm
ntpath.cpython-34.pyo133050644editdlrm
nturl2path.cpython-34.pyc17160644editdlrm
nturl2path.cpython-34.pyo17160644editdlrm
numbers.cpython-34.pyc126670644editdlrm
numbers.cpython-34.pyo126670644editdlrm
opcode.cpython-34.pyc51740644editdlrm
opcode.cpython-34.pyo51740644editdlrm
operator.cpython-34.pyc127780644editdlrm
operator.cpython-34.pyo127780644editdlrm
optparse.cpython-34.pyc515370644editdlrm
optparse.cpython-34.pyo514600644editdlrm
os.cpython-34.pyc295990644editdlrm
os.cpython-34.pyo295990644editdlrm
pathlib.cpython-34.pyc404830644editdlrm
pathlib.cpython-34.pyo404830644editdlrm
pdb.cpython-34.pyc494720644editdlrm
pdb.cpython-34.pyo494060644editdlrm
pickle.cpython-34.pyc469840644editdlrm
pickle.cpython-34.pyo468380644editdlrm
pickletools.cpython-34.pyc702540644editdlrm
pickletools.cpython-34.pyo691670644editdlrm
pipes.cpython-34.pyc84310644editdlrm
pipes.cpython-34.pyo84310644editdlrm
pkgutil.cpython-34.pyc176000644editdlrm
pkgutil.cpython-34.pyo176000644editdlrm
platform.cpython-34.pyc311720644editdlrm
platform.cpython-34.pyo311720644editdlrm
plistlib.cpython-34.pyc301510644editdlrm
plistlib.cpython-34.pyo300680644editdlrm
poplib.cpython-34.pyc137540644editdlrm
poplib.cpython-34.pyo137540644editdlrm
posixpath.cpython-34.pyc98090644editdlrm
posixpath.cpython-34.pyo98090644editdlrm
pprint.cpython-34.pyc114600644editdlrm
pprint.cpython-34.pyo112950644editdlrm
profile.cpython-34.pyc151510644editdlrm
profile.cpython-34.pyo148980644editdlrm
pstats.cpython-34.pyc236750644editdlrm
pstats.cpython-34.pyo236750644editdlrm
pty.cpython-34.pyc42250644editdlrm
pty.cpython-34.pyo42250644editdlrm
pyclbr.cpython-34.pyc91920644editdlrm
pyclbr.cpython-34.pyo91920644editdlrm
pydoc.cpython-34.pyc909150644editdlrm
pydoc.cpython-34.pyo908540644editdlrm
py_compile.cpython-34.pyc68570644editdlrm
py_compile.cpython-34.pyo68570644editdlrm
queue.cpython-34.pyc92620644editdlrm
queue.cpython-34.pyo92620644editdlrm
quopri.cpython-34.pyc64460644editdlrm
quopri.cpython-34.pyo62360644editdlrm
random.cpython-34.pyc190590644editdlrm
random.cpython-34.pyo190590644editdlrm
re.cpython-34.pyc145500644editdlrm
re.cpython-34.pyo145500644editdlrm
reprlib.cpython-34.pyc58720644editdlrm
reprlib.cpython-34.pyo58720644editdlrm
rlcompleter.cpython-34.pyc56950644editdlrm
rlcompleter.cpython-34.pyo56950644editdlrm
runpy.cpython-34.pyc77530644editdlrm
runpy.cpython-34.pyo77530644editdlrm
sched.cpython-34.pyc65730644editdlrm
sched.cpython-34.pyo65730644editdlrm
selectors.cpython-34.pyc167440644editdlrm
selectors.cpython-34.pyo167440644editdlrm
shelve.cpython-34.pyc99550644editdlrm
shelve.cpython-34.pyo99550644editdlrm
shlex.cpython-34.pyc75180644editdlrm
shlex.cpython-34.pyo75180644editdlrm
shutil.cpython-34.pyc330150644editdlrm
shutil.cpython-34.pyo330150644editdlrm
site.cpython-34.pyc179710644editdlrm
site.cpython-34.pyo179710644editdlrm
smtpd.cpython-34.pyc256690644editdlrm
smtpd.cpython-34.pyo256690644editdlrm
smtplib.cpython-34.pyc331290644editdlrm
smtplib.cpython-34.pyo330550644editdlrm
sndhdr.cpython-34.pyc67690644editdlrm
sndhdr.cpython-34.pyo67690644editdlrm
socket.cpython-34.pyc181110644editdlrm
socket.cpython-34.pyo180610644editdlrm
socketserver.cpython-34.pyc232550644editdlrm
socketserver.cpython-34.pyo232550644editdlrm
sre_compile.cpython-34.pyc119350644editdlrm
sre_compile.cpython-34.pyo117780644editdlrm
sre_constants.cpython-34.pyc55810644editdlrm
sre_constants.cpython-34.pyo55810644editdlrm
sre_parse.cpython-34.pyc202380644editdlrm
sre_parse.cpython-34.pyo202380644editdlrm
ssl.cpython-34.pyc276080644editdlrm
ssl.cpython-34.pyo276080644editdlrm
stat.cpython-34.pyc35780644editdlrm
stat.cpython-34.pyo35780644editdlrm
statistics.cpython-34.pyc171580644editdlrm
statistics.cpython-34.pyo168560644editdlrm
string.cpython-34.pyc83760644editdlrm
string.cpython-34.pyo83760644editdlrm
stringprep.cpython-34.pyc136360644editdlrm
stringprep.cpython-34.pyo135730644editdlrm
struct.cpython-34.pyc3470644editdlrm
struct.cpython-34.pyo3470644editdlrm
subprocess.cpython-34.pyc433590644editdlrm
subprocess.cpython-34.pyo432460644editdlrm
sunau.cpython-34.pyc183090644editdlrm
sunau.cpython-34.pyo183090644editdlrm
symbol.cpython-34.pyc26620644editdlrm
symbol.cpython-34.pyo26620644editdlrm
symtable.cpython-34.pyc113050644editdlrm
symtable.cpython-34.pyo111830644editdlrm
sysconfig.cpython-34.pyc172870644editdlrm
sysconfig.cpython-34.pyo172870644editdlrm
tabnanny.cpython-34.pyc77490644editdlrm
tabnanny.cpython-34.pyo77490644editdlrm
tarfile.cpython-34.pyc680400644editdlrm
tarfile.cpython-34.pyo680400644editdlrm
telnetlib.cpython-34.pyc193940644editdlrm
telnetlib.cpython-34.pyo193940644editdlrm
tempfile.cpython-34.pyc215760644editdlrm
tempfile.cpython-34.pyo215760644editdlrm
textwrap.cpython-34.pyc138000644editdlrm
textwrap.cpython-34.pyo137140644editdlrm
this.cpython-34.pyc13160644editdlrm
this.cpython-34.pyo13160644editdlrm
threading.cpython-34.pyc389650644editdlrm
threading.cpython-34.pyo382520644editdlrm
timeit.cpython-34.pyc110620644editdlrm
timeit.cpython-34.pyo110620644editdlrm
token.cpython-34.pyc36150644editdlrm
token.cpython-34.pyo36150644editdlrm
tokenize.cpython-34.pyc199510644editdlrm
tokenize.cpython-34.pyo199010644editdlrm
trace.cpython-34.pyc241840644editdlrm
trace.cpython-34.pyo241270644editdlrm
traceback.cpython-34.pyc110910644editdlrm
traceback.cpython-34.pyo110910644editdlrm
tracemalloc.cpython-34.pyc171300644editdlrm
tracemalloc.cpython-34.pyo171300644editdlrm
tty.cpython-34.pyc11460644editdlrm
tty.cpython-34.pyo11460644editdlrm
types.cpython-34.pyc55600644editdlrm
types.cpython-34.pyo55600644editdlrm
uu.cpython-34.pyc40210644editdlrm
uu.cpython-34.pyo40210644editdlrm
uuid.cpython-34.pyc218640644editdlrm
uuid.cpython-34.pyo218020644editdlrm
warnings.cpython-34.pyc122680644editdlrm
warnings.cpython-34.pyo115360644editdlrm
wave.cpython-34.pyc191350644editdlrm
wave.cpython-34.pyo190740644editdlrm
weakref.cpython-34.pyc203450644editdlrm
weakref.cpython-34.pyo203080644editdlrm
webbrowser.cpython-34.pyc171320644editdlrm
webbrowser.cpython-34.pyo170930644editdlrm
xdrlib.cpython-34.pyc90020644editdlrm
xdrlib.cpython-34.pyo90020644editdlrm
zipfile.cpython-34.pyc458200644editdlrm
zipfile.cpython-34.pyo457710644editdlrm
_bootlocale.cpython-34.pyc10470644editdlrm
_bootlocale.cpython-34.pyo10160644editdlrm
_collections_abc.cpython-34.pyc239490644editdlrm
_collections_abc.cpython-34.pyo239490644editdlrm
_compat_pickle.cpython-34.pyc75010644editdlrm
_compat_pickle.cpython-34.pyo74270644editdlrm
_dummy_thread.cpython-34.pyc48250644editdlrm
_dummy_thread.cpython-34.pyo48250644editdlrm
_markupbase.cpython-34.pyc89320644editdlrm
_markupbase.cpython-34.pyo87450644editdlrm
_osx_support.cpython-34.pyc106300644editdlrm
_osx_support.cpython-34.pyo106300644editdlrm
_pyio.cpython-34.pyc649330644editdlrm
_pyio.cpython-34.pyo649070644editdlrm
_sitebuiltins.cpython-34.pyc36770644editdlrm
_sitebuiltins.cpython-34.pyo36770644editdlrm
_strptime.cpython-34.pyc157790644editdlrm
_strptime.cpython-34.pyo157790644editdlrm
_sysconfigdata.cpython-34.pyc227000644editdlrm
_sysconfigdata.cpython-34.pyo227000644editdlrm
_threading_local.cpython-34.pyc69460644editdlrm
_threading_local.cpython-34.pyo69460644editdlrm
_weakrefset.cpython-34.pyc84650644editdlrm
_weakrefset.cpython-34.pyo84650644editdlrm
__future__.cpython-34.pyc41680644editdlrm
__future__.cpython-34.pyo41680644editdlrm
__phello__.foo.cpython-34.pyc1340644editdlrm
__phello__.foo.cpython-34.pyo1340644editdlrm
Edit: /opt/alt/python34/lib64/python3.4/__pycache__/codecs.cpython-34.pyc (35132B)
fF9@sdZddlZddlZyddlTWn5ek rcZzedeWYddZ[XnXddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/g+Zd0Zd1Z Z d2Z Z d3Z d4Zejd5kr3e ZZe Zne ZZeZe Ze Ze ZeZGd6ddeZGd7ddZGd8ddeZGd9d:d:eZGd;ddeZGd<d=d=eZGd>ddeZGd?ddeZ Gd@ddZ!GdAddZ"dBddCdDdEdZ#ddCdFdZ$dGdZ%dHd Z&dId!Z'dJd"Z(dKd#Z)dLd$Z*dCdMd'Z+dCdNd(Z,dOdPZ-dQdRZ.y@e/dCZ0e/dSZ1e/dTZ2e/dUZ3e/dVZ4Wn0e5k rHdZ0dZ1dZ2dZ3dZ4YnXdZ6e6rdddl7Z7ne8dWkre$ej9dXdYe_9e$ej:dYdXe_:ndS)Zz codecs -- Python Codec Registry, API and helpers. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. N)*z%Failed to load the builtin codecs: %sregisterlookupopen EncodedFileBOMBOM_BEBOM_LEBOM32_BEBOM32_LEBOM64_BEBOM64_LEBOM_UTF8 BOM_UTF16 BOM_UTF16_LE BOM_UTF16_BE BOM_UTF32 BOM_UTF32_LE BOM_UTF32_BE CodecInfoCodecIncrementalEncoderIncrementalDecoder StreamReader StreamWriterStreamReaderWriter StreamRecoder getencoder getdecodergetincrementalencodergetincrementaldecoder getreader getwriterencodedecode iterencode iterdecode strict_errors ignore_errorsreplace_errorsxmlcharrefreplace_errorsbackslashreplace_errorsregister_error lookup_errorssssslittlec @sIeZdZdZdZdddddddddZddZdS) rz0Codec details when looking up the codec registryTN_is_text_encodingc Csytj|||||f} || _|| _|| _|| _|| _|| _|| _|dk ru|| _ n| S)N) tuple__new__namer#r$incrementalencoderincrementaldecoder streamwriter streamreaderr/) clsr#r$r6r5r3r4r2r/selfr9+/opt/alt/python34/lib64/python3.4/codecs.pyr1\s         zCodecInfo.__new__cCs)d|jj|jj|jt|fS)Nz&<%s.%s object for encoding %s at 0x%x>) __class__ __module____name__r2id)r8r9r9r:__repr__kszCodecInfo.__repr__)r=r< __qualname____doc__r/r1r?r9r9r9r:rQs   c@s4eZdZdZdddZdddZdS)ra Defines the interface for stateless encoders/decoders. The .encode()/.decode() methods may use different error handling schemes by providing the errors argument. These string values are predefined: 'strict' - raise a ValueError error (or a subclass) 'ignore' - ignore the character and continue with the next 'replace' - replace with a suitable replacement character; Python will use the official U+FFFD REPLACEMENT CHARACTER for the builtin Unicode codecs on decoding and '?' on encoding. 'surrogateescape' - replace with private code points U+DCnn. 'xmlcharrefreplace' - Replace with the appropriate XML character reference (only for encoding). 'backslashreplace' - Replace with backslashed escape sequences (only for encoding). The set of allowed values can be extended via register_error. strictcCs tdS)a# Encodes the object input and returns a tuple (output object, length consumed). errors defines the error handling to apply. It defaults to 'strict' handling. The method may not store state in the Codec instance. Use StreamWriter for codecs which have to keep state in order to make encoding efficient. The encoder must be able to handle zero length input and return an empty object of the output object type in this situation. N)NotImplementedError)r8inputerrorsr9r9r:r#sz Codec.encodecCs tdS)a Decodes the object input and returns a tuple (output object, length consumed). input must be an object which provides the bf_getreadbuf buffer slot. Python strings, buffer objects and memory mapped files are examples of objects providing this slot. errors defines the error handling to apply. It defaults to 'strict' handling. The method may not store state in the Codec instance. Use StreamReader for codecs which have to keep state in order to make decoding efficient. The decoder must be able to handle zero length input and return an empty object of the output object type in this situation. N)rC)r8rDrEr9r9r:r$sz Codec.decodeN)r=r<r@rAr#r$r9r9r9r:rps c@sXeZdZdZdddZdddZdd Zd d Zd d ZdS)rz An IncrementalEncoder encodes an input in multiple steps. The input can be passed piece by piece to the encode() method. The IncrementalEncoder remembers the state of the encoding process between calls to encode(). rBcCs||_d|_dS)z Creates an IncrementalEncoder instance. The IncrementalEncoder may use different error handling schemes by providing the errors keyword argument. See the module docstring for a list of possible values. N)rEbuffer)r8rEr9r9r:__init__s zIncrementalEncoder.__init__FcCs tdS)zA Encodes input and returns the resulting object. N)rC)r8rDfinalr9r9r:r#szIncrementalEncoder.encodecCsdS)z: Resets the encoder to the initial state. Nr9)r8r9r9r:resetszIncrementalEncoder.resetcCsdS)z: Return the current state of the encoder. rr9)r8r9r9r:getstateszIncrementalEncoder.getstatecCsdS)zl Set the current state of the encoder. state must have been returned by getstate(). Nr9)r8stater9r9r:setstateszIncrementalEncoder.setstateN) r=r<r@rArHr#rJrKrMr9r9r9r:rs    c@sdeZdZdZdddZddZddd Zd d Zd d ZddZ dS)BufferedIncrementalEncoderz This subclass of IncrementalEncoder can be used as the baseclass for an incremental encoder if the encoder must keep some of the output in a buffer between calls to encode(). rBcCstj||d|_dS)NrF)rrHrG)r8rEr9r9r:rHsz#BufferedIncrementalEncoder.__init__cCs tdS)N)rC)r8rDrErIr9r9r:_buffer_encodesz)BufferedIncrementalEncoder._buffer_encodeFcCsB|j|}|j||j|\}}||d|_|S)N)rGrOrE)r8rDrIdataresultconsumedr9r9r:r#s z!BufferedIncrementalEncoder.encodecCstj|d|_dS)NrF)rrJrG)r8r9r9r:rJs z BufferedIncrementalEncoder.resetcCs |jp dS)Nr)rG)r8r9r9r:rKsz#BufferedIncrementalEncoder.getstatecCs|p d|_dS)NrF)rG)r8rLr9r9r:rMsz#BufferedIncrementalEncoder.setstateN) r=r<r@rArHrOr#rJrKrMr9r9r9r:rNs    rNc@sXeZdZdZdddZdddZdd Zd d Zd d ZdS)rz An IncrementalDecoder decodes an input in multiple steps. The input can be passed piece by piece to the decode() method. The IncrementalDecoder remembers the state of the decoding process between calls to decode(). rBcCs ||_dS)z Create an IncrementalDecoder instance. The IncrementalDecoder may use different error handling schemes by providing the errors keyword argument. See the module docstring for a list of possible values. N)rE)r8rEr9r9r:rHszIncrementalDecoder.__init__FcCs tdS)z@ Decode input and returns the resulting object. N)rC)r8rDrIr9r9r:r$ szIncrementalDecoder.decodecCsdS)z9 Reset the decoder to the initial state. Nr9)r8r9r9r:rJszIncrementalDecoder.resetcCsdS)a  Return the current state of the decoder. This must be a (buffered_input, additional_state_info) tuple. buffered_input must be a bytes object containing bytes that were passed to decode() that have not yet been converted. additional_state_info must be a non-negative integer representing the state of the decoder WITHOUT yet having processed the contents of buffered_input. In the initial state and after reset(), getstate() must return (b"", 0). r)rSrr9)r8r9r9r:rKs zIncrementalDecoder.getstatecCsdS)z Set the current state of the decoder. state must have been returned by getstate(). The effect of setstate((b"", 0)) must be equivalent to reset(). Nr9)r8rLr9r9r:rM$szIncrementalDecoder.setstateN) r=r<r@rArHr$rJrKrMr9r9r9r:rs    c@sdeZdZdZdddZddZddd Zd d Zd d ZddZ dS)BufferedIncrementalDecoderz This subclass of IncrementalDecoder can be used as the baseclass for an incremental decoder if the decoder must be able to handle incomplete byte sequences. rBcCstj||d|_dS)NrS)rrHrG)r8rEr9r9r:rH2sz#BufferedIncrementalDecoder.__init__cCs tdS)N)rC)r8rDrErIr9r9r:_buffer_decode7sz)BufferedIncrementalDecoder._buffer_decodeFcCsB|j|}|j||j|\}}||d|_|S)N)rGrUrE)r8rDrIrPrQrRr9r9r:r$<s z!BufferedIncrementalDecoder.decodecCstj|d|_dS)NrS)rrJrG)r8r9r9r:rJDs z BufferedIncrementalDecoder.resetcCs |jdfS)Nr)rG)r8r9r9r:rKHsz#BufferedIncrementalDecoder.getstatecCs|d|_dS)Nr)rG)r8rLr9r9r:rMLsz#BufferedIncrementalDecoder.setstateN) r=r<r@rArHrUr$rJrKrMr9r9r9r:rT,s    rTc@syeZdZdddZddZddZdd Zd d d Zed dZ ddZ ddZ dS)rrBcCs||_||_dS)aA Creates a StreamWriter instance. stream must be a file-like object open for writing. The StreamWriter may use different error handling schemes by providing the errors keyword argument. These parameters are predefined: 'strict' - raise a ValueError (or a subclass) 'ignore' - ignore the character and continue with the next 'replace'- replace with a suitable replacement character 'xmlcharrefreplace' - Replace with the appropriate XML character reference. 'backslashreplace' - Replace with backslashed escape sequences (only for encoding). The set of allowed parameter values can be extended via register_error. N)streamrE)r8rVrEr9r9r:rHYs zStreamWriter.__init__cCs/|j||j\}}|jj|dS)z> Writes the object's contents encoded to self.stream. N)r#rErVwrite)r8objectrPrRr9r9r:rWqszStreamWriter.writecCs|jdj|dS)z[ Writes the concatenated list of strings to the stream using .write(). rFN)rWjoin)r8listr9r9r: writelinesxszStreamWriter.writelinescCsdS)a5 Flushes and resets the codec buffers used for keeping state. Calling this method should ensure that the data on the output is put into a clean state, that allows appending of new fresh data without having to rescan the whole stream to recover state. Nr9)r8r9r9r:rJs zStreamWriter.resetrcCs<|jj|||dkr8|dkr8|jndS)Nr)rVseekrJ)r8offsetwhencer9r9r:r\szStreamWriter.seekcCs||j|S)z? Inherit all other methods from the underlying stream. )rV)r8r2getattrr9r9r: __getattr__szStreamWriter.__getattr__cCs|S)Nr9)r8r9r9r: __enter__szStreamWriter.__enter__cCs|jjdS)N)rVclose)r8typevaluetbr9r9r:__exit__szStreamWriter.__exit__N) r=r<r@rHrWr[rJr\r_r`rarfr9r9r9r:rWs     c@seZdZeZdddZdddZdd ddd Zd d d d Zd d ddZ ddZ dddZ ddZ ddZ eddZddZddZd S)!rrBcCsC||_||_d|_|j|_|j|_d|_dS)aA Creates a StreamReader instance. stream must be a file-like object open for reading. The StreamReader may use different error handling schemes by providing the errors keyword argument. These parameters are predefined: 'strict' - raise a ValueError (or a subclass) 'ignore' - ignore the character and continue with the next 'replace'- replace with a suitable replacement character; The set of allowed parameter values can be extended via register_error. rSN)rVrE bytebuffercharbuffertype_empty_charbuffer charbuffer linebuffer)r8rVrEr9r9r:rHs     zStreamReader.__init__cCs tdS)N)rC)r8rDrEr9r9r:r$szStreamReader.decodeFc Cs|jr-|jj|j|_d|_nxl|dkrXt|j|krPqn(|dkrt|j|krPqn|dkr|jj}n|jj|}|j|}|sPny|j||j \}}Wnt k rk}zc|rV|j|d|j |j \}}|j dd} t| dkrYqYnWYdd}~XnX||d|_|j|7_|s0Pq0q0W|dkr|j} |j|_n)|jd|} |j|d|_| S)a Decodes data from the stream self.stream and returns the resulting object. chars indicates the number of decoded code points or bytes to return. read() will never return more data than requested, but it might return less, if there is not enough available. size indicates the approximate maximum number of decoded bytes or code points to read for decoding. The decoder can modify this setting as appropriate. The default value -1 indicates to read and decode as much as possible. size is intended to prevent having to decode huge files in one step. If firstline is true, and a UnicodeDecodeError happens after the first line terminator in the input only the first line will be returned, the rest of the input will be kept until the next call to read(). The method should use a greedy read strategy, meaning that it should read as much data as is allowed within the definition of the encoding and the given size, e.g. if optional encoding endings or state markers are available on the stream, these should be read too. NrkeependsTrl) rkrirYrjlenrVreadrgr$rEUnicodeDecodeErrorstart splitlines) r8sizechars firstlinenewdatarPnewchars decodedbytesexclinesrQr9r9r:rosF      (   zStreamReader.readNTc Cs|jrt|jd}|jd=t|jdkrQ|jd|_d|_n|sp|jddd}n|S|p}d}|j}x|j|dd}|rt|tr|jd st|t r|jd r||jd dd d7}qn||7}|jdd}|r+t|dkr|d}|d=t|dkr|d|j7<||_d|_n|d|j|_|s|jddd}nPn|d}|djddd}||kr+|jj |dd|j|_|r|}n|}Pq+n| s>|dk rh|rd| rd|jddd}nPn|d kr|d9}qqW|S)z Read one line from the input stream and return the decoded data. size, if given, is passed as size argument to the read() method. rrlNrmFHruT s rsrti@) rkrnrjrrriro isinstancestrendswithbytesrY) r8rsrmlinereadsizerPrz line0withendline0withoutendr9r9r:readline s^      "          zStreamReader.readlinecCs|j}|j|S)aS Read all lines available on the input stream and return them as a list. Line breaks are implemented using the codec's decoder method and are included in the list entries. sizehint, if given, is ignored since there is no efficient way to finding the true end-of-line. )rorr)r8sizehintrmrPr9r9r: readlinesWs zStreamReader.readlinescCs"d|_|j|_d|_dS)z Resets the codec buffers used for keeping state. Note that no stream repositioning should take place. This method is primarily intended to be able to recover from decoding errors. rSN)rgrirjrk)r8r9r9r:rJfs  zStreamReader.resetrcCs!|jj|||jdS)zp Set the input stream's current position. Resets the codec buffers used for keeping state. N)rVr\rJ)r8r]r^r9r9r:r\sszStreamReader.seekcCs |j}|r|StdS)z4 Return the next decoded line from the input stream.N)r StopIteration)r8rr9r9r:__next__{s zStreamReader.__next__cCs|S)Nr9)r8r9r9r:__iter__szStreamReader.__iter__cCs||j|S)z? Inherit all other methods from the underlying stream. )rV)r8r2r_r9r9r:r`szStreamReader.__getattr__cCs|S)Nr9)r8r9r9r:raszStreamReader.__enter__cCs|jjdS)N)rVrb)r8rcrdrer9r9r:rfszStreamReader.__exit__r~r~)r=r<r@rrhrHr$rorrrJr\rrr_r`rarfr9r9r9r:rs NK    c@seZdZdZdZdddZd!ddZd d d Zd d d ZddZ ddZ ddZ ddZ ddZ dddZeddZddZdd Zd S)"ra StreamReaderWriter instances allow wrapping streams which work in both read and write modes. The design is such that one can use the factory functions returned by the codec.lookup() function to construct the instance. unknownrBcCs:||_||||_||||_||_dS)aR Creates a StreamReaderWriter instance. stream must be a Stream-like object. Reader, Writer must be factory functions or classes providing the StreamReader, StreamWriter interface resp. Error handling is done in the same way as defined for the StreamWriter/Readers. N)rVreaderwriterrE)r8rVReaderWriterrEr9r9r:rHs zStreamReaderWriter.__init__rlcCs|jj|S)N)rro)r8rsr9r9r:roszStreamReaderWriter.readNcCs|jj|S)N)rr)r8rsr9r9r:rszStreamReaderWriter.readlinecCs|jj|S)N)rr)r8rr9r9r:rszStreamReaderWriter.readlinescCs t|jS)z4 Return the next decoded line from the input stream.)nextr)r8r9r9r:rszStreamReaderWriter.__next__cCs|S)Nr9)r8r9r9r:rszStreamReaderWriter.__iter__cCs|jj|S)N)rrW)r8rPr9r9r:rWszStreamReaderWriter.writecCs|jj|S)N)rr[)r8rZr9r9r:r[szStreamReaderWriter.writelinescCs|jj|jjdS)N)rrJr)r8r9r9r:rJs zStreamReaderWriter.resetrcCsL|jj|||jj|dkrH|dkrH|jjndS)Nr)rVr\rrJr)r8r]r^r9r9r:r\s zStreamReaderWriter.seekcCs||j|S)z? Inherit all other methods from the underlying stream. )rV)r8r2r_r9r9r:r`szStreamReaderWriter.__getattr__cCs|S)Nr9)r8r9r9r:raszStreamReaderWriter.__enter__cCs|jjdS)N)rVrb)r8rcrdrer9r9r:rfszStreamReaderWriter.__exit__r~)r=r<r@rAencodingrHrorrrrrWr[rJr\r_r`rarfr9r9r9r:rs       c@seZdZdZdZdZdddZdddZd d d Zd d d Z ddZ ddZ ddZ ddZ ddZeddZddZddZd S)raB StreamRecoder instances translate data from one encoding to another. They use the complete set of APIs returned by the codecs.lookup() function to implement their task. Data written to the StreamRecoder is first decoded into an intermediate format (depending on the "decode" codec) and then written to the underlying stream using an instance of the provided Writer class. In the other direction, data is read from the underlying stream using a Reader instance and then encoded and returned to the caller. rrBcCsL||_||_||_||||_||||_||_dS)a Creates a StreamRecoder instance which implements a two-way conversion: encode and decode work on the frontend (the data visible to .read() and .write()) while Reader and Writer work on the backend (the data in stream). You can use these objects to do transparent transcodings from e.g. latin-1 to utf-8 and back. stream must be a file-like object. encode and decode must adhere to the Codec interface; Reader and Writer must be factory functions or classes providing the StreamReader and StreamWriter interfaces resp. Error handling is done in the same way as defined for the StreamWriter/Readers. N)rVr#r$rrrE)r8rVr#r$rrrEr9r9r:rHs    zStreamRecoder.__init__rlcCs1|jj|}|j||j\}}|S)N)rror#rE)r8rsrP bytesencodedr9r9r:roszStreamRecoder.readNcCsO|dkr|jj}n|jj|}|j||j\}}|S)N)rrr#rE)r8rsrPrr9r9r:r"s  zStreamRecoder.readlinecCs:|jj}|j||j\}}|jddS)NrmT)rror#rErr)r8rrPrr9r9r:r+szStreamRecoder.readlinescCs.t|j}|j||j\}}|S)z4 Return the next decoded line from the input stream.)rrr#rE)r8rPrr9r9r:r1szStreamRecoder.__next__cCs|S)Nr9)r8r9r9r:r8szStreamRecoder.__iter__cCs+|j||j\}}|jj|S)N)r$rErrW)r8rP bytesdecodedr9r9r:rW;szStreamRecoder.writecCs:dj|}|j||j\}}|jj|S)NrF)rYr$rErrW)r8rZrPrr9r9r:r[@szStreamRecoder.writelinescCs|jj|jjdS)N)rrJr)r8r9r9r:rJFs zStreamRecoder.resetcCs||j|S)z? Inherit all other methods from the underlying stream. )rV)r8r2r_r9r9r:r`KszStreamRecoder.__getattr__cCs|S)Nr9)r8r9r9r:raRszStreamRecoder.__enter__cCs|jjdS)N)rVrb)r8rcrdrer9r9r:rfUszStreamRecoder.__exit__r~)r=r<r@rA data_encoding file_encodingrHrorrrrrWr[rJr_r`rarfr9r9r9r:rs        rrBrlcCs~|dk r%d|kr%|d}ntj|||}|dkrJ|St|}t||j|j|}||_|S)a> Open an encoded file using the given mode and return a wrapped version providing transparent encoding/decoding. Note: The wrapped version will only accept the object format defined by the codecs, i.e. Unicode objects for most builtin codecs. Output is also codec dependent and will usually be Unicode as well. Underlying encoded files are always opened in binary mode. The default file mode is 'r', meaning to open the file in read mode. encoding specifies the encoding which is to be used for the file. errors may be given to define the error handling. It defaults to 'strict' which causes ValueErrors to be raised in case an encoding error occurs. buffering has the same meaning as for the builtin open() API. It defaults to line buffered. The returned wrapped file object provides an extra attribute .encoding which allows querying the used encoding. This attribute is only available if an encoding was specified as parameter. Nb)builtinsrrrr6r5r)filenamemoderrE bufferingfileinfosrwr9r9r:rZs      cCsj|dkr|}nt|}t|}t||j|j|j|j|}||_||_|S)a Return a wrapped version of file which provides transparent encoding translation. Data written to the wrapped file is decoded according to the given data_encoding and then encoded to the underlying file using file_encoding. The intermediate data type will usually be Unicode but depends on the specified codecs. Bytes read from the file are decoded using file_encoding and then passed back to the caller encoded using data_encoding. If file_encoding is not given, it defaults to data_encoding. errors may be given to define the error handling. It defaults to 'strict' which causes ValueErrors to be raised in case an encoding error occurs. The returned wrapped file object provides two extra attributes .data_encoding and .file_encoding which reflect the given parameters of the same name. The attributes can be used for introspection by Python programs. N)rrr#r$r6r5rr)rrrrE data_info file_infosrr9r9r:rs      cCs t|jS)z Lookup up the codec for the given encoding and return its encoder function. Raises a LookupError in case the encoding cannot be found. )rr#)rr9r9r:rscCs t|jS)z Lookup up the codec for the given encoding and return its decoder function. Raises a LookupError in case the encoding cannot be found. )rr$)rr9r9r:rscCs.t|j}|dkr*t|n|S)z Lookup up the codec for the given encoding and return its IncrementalEncoder class or factory function. Raises a LookupError in case the encoding cannot be found or the codecs doesn't provide an incremental encoder. N)rr3 LookupError)rencoderr9r9r:rs  cCs.t|j}|dkr*t|n|S)z Lookup up the codec for the given encoding and return its IncrementalDecoder class or factory function. Raises a LookupError in case the encoding cannot be found or the codecs doesn't provide an incremental decoder. N)rr4r)rdecoderr9r9r:r s  cCs t|jS)z Lookup up the codec for the given encoding and return its StreamReader class or factory function. Raises a LookupError in case the encoding cannot be found. )rr6)rr9r9r:r!scCs t|jS)z Lookup up the codec for the given encoding and return its StreamWriter class or factory function. Raises a LookupError in case the encoding cannot be found. )rr5)rr9r9r:r"scksgt|||}x+|D]#}|j|}|r|VqqW|jdd}|rc|VndS)z Encoding iterator. Encodes the input strings from the iterator using an IncrementalEncoder. errors and kwargs are passed through to the IncrementalEncoder constructor. rFTN)rr#)iteratorrrEkwargsrrDoutputr9r9r:r%s   cksgt|||}x+|D]#}|j|}|r|VqqW|jdd}|rc|VndS)z Decoding iterator. Decodes the input strings from the iterator using an IncrementalDecoder. errors and kwargs are passed through to the IncrementalDecoder constructor. rSTN)r r$)rrrErrrDrr9r9r:r&s   cCsdd|DS)z make_identity_dict(rng) -> dict Return a dictionary where elements of the rng sequence are mapped to themselves. cSsi|]}||qSr9r9).0ir9r9r: s z&make_identity_dict..r9)rngr9r9r:make_identity_dictsrcCsJi}x=|jD]/\}}||kr8|||s#             A("1+HWn*&