fc@sdZddlZddlZddlZddlZyddlmZWn"ek rnddl mZYnXddl Z ddl m Z m Z m Z mZdddhZeedrejejejejndd ZeZd d eeeeed d ZGd ddZGdddZy e jZWn+ek rpGdddeeZYnXGddddejZ e j j!e Gddde Z"e j"j!e"ddl#m$Z$e"j!e$Gddde Z%e j%j!e%Gddde%Z&Gddde%Z'Gdd d e&Z(Gd!d"d"e&Z)Gd#d$d$e%Z*Gd%d&d&e)e(Z+Gd'd(d(e Z,e j,j!e,Gd)d*d*ej-Z.Gd+d,d,e,Z/Gd-d.d.e/Z0dS(/u) Python implementation of the io module. iN(u allocate_lock(u__all__uSEEK_SETuSEEK_CURuSEEK_ENDiiu SEEK_HOLEiiurc(Cs>t|tttfs+td|nt|tsMtd|nt|tsotd|n|dk rt|t rtd|n|dk rt|t rtd|nt|}|tdst|t|krtd|nd|k} d|k} d |k} d |k} d |k} d |k}d |k}d|kr| s| s| rtdnd} n|r|rtdn| | | | dkrtdn| p| p| p| stdn|r(|dk r(tdn|rI|dk rItdn|rj|dk rjtdnt || r|dpd| rdpd| rd pd| rd pd| rd pd|d|}d}|dks|dkr|j rd }d}n|dkrkt }ytj|jj}Wntjtfk rRYqkX|dkrk|}qkn|dkrtdn|dkr|r|Stdn| rt||}nL| s| s| rt||}n(| rt||}ntd||r|St|||||}||_|S(!uOpen file and return a stream. Raise IOError upon failure. file is either a text or byte string giving the name (and the path if the file isn't in the current working directory) of the file to be opened or an integer file descriptor of the file to be wrapped. (If a file descriptor is given, it is closed when the returned I/O object is closed, unless closefd is set to False.) mode is an optional string that specifies the mode in which the file is opened. It defaults to 'r' which means open for reading in text mode. Other common values are 'w' for writing (truncating the file if it already exists), 'x' for exclusive creation of a new file, and 'a' for appending (which on some Unix systems, means that all writes append to the end of the file regardless of the current seek position). In text mode, if encoding is not specified the encoding used is platform dependent. (For reading and writing raw bytes use binary mode and leave encoding unspecified.) The available modes are: ========= =============================================================== Character Meaning --------- --------------------------------------------------------------- 'r' open for reading (default) 'w' open for writing, truncating the file first 'x' create a new file and open it for writing 'a' open for writing, appending to the end of the file if it exists 'b' binary mode 't' text mode (default) '+' open a disk file for updating (reading and writing) 'U' universal newline mode (for backwards compatibility; unneeded for new code) ========= =============================================================== The default mode is 'rt' (open for reading text). For binary random access, the mode 'w+b' opens and truncates the file to 0 bytes, while 'r+b' opens the file without truncation. The 'x' mode implies 'w' and raises an `FileExistsError` if the file already exists. Python distinguishes between files opened in binary and text modes, even when the underlying operating system doesn't. Files opened in binary mode (appending 'b' to the mode argument) return contents as bytes objects without any decoding. In text mode (the default, or when 't' is appended to the mode argument), the contents of the file are returned as strings, the bytes having been first decoded using a platform-dependent encoding or using the specified encoding if given. buffering is an optional integer used to set the buffering policy. Pass 0 to switch buffering off (only allowed in binary mode), 1 to select line buffering (only usable in text mode), and an integer > 1 to indicate the size of a fixed-size chunk buffer. When no buffering argument is given, the default buffering policy works as follows: * Binary files are buffered in fixed-size chunks; the size of the buffer is chosen using a heuristic trying to determine the underlying device's "block size" and falling back on `io.DEFAULT_BUFFER_SIZE`. On many systems, the buffer will typically be 4096 or 8192 bytes long. * "Interactive" text files (files for which isatty() returns True) use line buffering. Other text files use the policy described above for binary files. encoding is the str name of the encoding used to decode or encode the file. This should only be used in text mode. The default encoding is platform dependent, but any encoding supported by Python can be passed. See the codecs module for the list of supported encodings. errors is an optional string that specifies how encoding errors are to be handled---this argument should not be used in binary mode. Pass 'strict' to raise a ValueError exception if there is an encoding error (the default of None has the same effect), or pass 'ignore' to ignore errors. (Note that ignoring encoding errors can lead to data loss.) See the documentation for codecs.register for a list of the permitted encoding error strings. newline is a string controlling how universal newlines works (it only applies to text mode). It can be None, '', '\n', '\r', and '\r\n'. It works as follows: * On input, if newline is None, universal newlines mode is enabled. Lines in the input can end in '\n', '\r', or '\r\n', and these are translated into '\n' before being returned to the caller. If it is '', universal newline mode is enabled, but line endings are returned to the caller untranslated. If it has any of the other legal values, input lines are only terminated by the given string, and the line ending is returned to the caller untranslated. * On output, if newline is None, any '\n' characters written are translated to the system default line separator, os.linesep. If newline is '', no translation takes place. If newline is any of the other legal values, any '\n' characters written are translated to the given string. closedfd is a bool. If closefd is False, the underlying file descriptor will be kept open when the file is closed. This does not work when a file name is given and must be True in that case. A custom opener can be used by passing a callable as *opener*. The underlying file descriptor for the file object is then obtained by calling *opener* with (*file*, *flags*). *opener* must return an open file descriptor (passing os.open as *opener* results in functionality similar to passing None). open() returns a file object whose type depends on the mode, and through which the standard file operations such as reading and writing are performed. When open() is used to open a file in a text mode ('w', 'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open a file in a binary mode, the returned class varies: in read binary mode, it returns a BufferedReader; in write binary and append binary modes, it returns a BufferedWriter, and in read/write mode, it returns a BufferedRandom. It is also possible to use a string or bytearray as a file for both reading and writing. For strings StringIO can be used like a file opened in a text mode, and for bytes a BytesIO can be used like a file opened in a binary mode. uinvalid file: %ruinvalid mode: %ruinvalid buffering: %ruinvalid encoding: %ruinvalid errors: %ruaxrwb+tUuxuruwuau+utubuUu$can't use U and writing mode at onceu'can't have text and binary mode at onceiu)can't have read/write/append mode at onceu/must have exactly one of read/write/append modeu-binary mode doesn't take an encoding argumentu+binary mode doesn't take an errors argumentu+binary mode doesn't take a newline argumentuuopeneriuinvalid buffering sizeucan't have unbuffered text I/Ouunknown mode: %rNTFi(u isinstanceustrubytesuintu TypeErroruNoneusetulenu ValueErroruTrueuFileIOuFalseuisattyuDEFAULT_BUFFER_SIZEuosufstatufilenou st_blksizeuerroruAttributeErroruBufferedRandomuBufferedWriteruBufferedReaderu TextIOWrapperumode(ufileumodeu bufferinguencodinguerrorsunewlineuclosefduopenerumodesucreatingureadinguwritingu appendinguupdatingutextubinaryurawuline_bufferingubsubuffer((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuopen"sv (          ?$       uopencBs&|EeZdZdZddZdS(u DocDescriptoru%Helper for builtins.open.__doc__ cCs dtjS(Nu\open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True) (uopenu__doc__(uselfuobjutyp((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__get__suDocDescriptor.__get__N(u__name__u __module__u __qualname__u__doc__u__get__(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu DocDescriptorsu DocDescriptorcBs/|EeZdZdZeZddZdS(u OpenWrapperuWrapper for builtins.open Trick so that open won't become a bound method when stored as a class variable (as dbm.dumb does). See initstdio() in Python/pythonrun.c. cOs t||S(N(uopen(uclsuargsukwargs((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__new__suOpenWrapper.__new__N(u__name__u __module__u __qualname__u__doc__u DocDescriptoru__new__(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu OpenWrappers u OpenWrappercBs|EeZdZdS(uUnsupportedOperationN(u__name__u __module__u __qualname__(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuUnsupportedOperationsuUnsupportedOperationcBs^|EeZdZdZddZdddZddZd4d d Zd d Z d5Z d dZ ddZ ddZd4ddZddZd4ddZddZd4ddZeddZd4dd Zd!d"Zd#d$Zd%d&Zd'd(Zd6d*d+Zd,d-Zd.d/Zd4d0d1Zd2d3Zd4S(7uIOBaseu-The abstract base class for all I/O classes, acting on streams of bytes. There is no public constructor. This class provides dummy implementations for many methods that derived classes can override selectively; the default implementations represent a file that cannot be read, written or seeked. Even though IOBase does not declare read, readinto, or write because their signatures will vary, implementations and clients should consider those methods part of the interface. Also, implementations may raise UnsupportedOperation when operations they do not support are called. The basic type used for binary data read from or written to a file is bytes. bytearrays are accepted too, and in some cases (such as readinto) needed. Text I/O classes work with str data. Note that calling any method (even inquiries) on a closed stream is undefined. Implementations may raise IOError in this case. IOBase (and its subclasses) support the iterator protocol, meaning that an IOBase object can be iterated over yielding the lines in a stream. IOBase also supports the :keyword:`with` statement. In this example, fp is closed after the suite of the with statement is complete: with open('spam.txt', 'r') as fp: fp.write('Spam and eggs!') cCs td|jj|fdS(u@Internal: raise an IOError exception for unsupported operations.u%s.%s() not supportedN(uUnsupportedOperationu __class__u__name__(uselfuname((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu _unsupported(suIOBase._unsupportedicCs|jddS(u$Change stream position. Change the stream position to byte offset pos. Argument pos is interpreted relative to the position indicated by whence. Values for whence are ints: * 0 -- start of stream (the default); offset should be zero or positive * 1 -- current stream position; offset may be negative * 2 -- end of stream; offset is usually negative Some operating systems / file systems could provide additional values. Return an int indicating the new absolute position. useekN(u _unsupported(uselfuposuwhence((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuseek/su IOBase.seekcCs|jddS(u5Return an int indicating the current stream position.ii(useek(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutell?su IOBase.tellcCs|jddS(uTruncate file to size bytes. Size defaults to the current IO position as reported by tell(). Return the new size. utruncateN(u _unsupported(uselfupos((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutruncateCsuIOBase.truncatecCs|jdS(uuFlush write buffers, if applicable. This is not implemented for read-only and non-blocking streams. N(u _checkClosed(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuflushMsu IOBase.flushc Cs+|js'z|jWdd|_XndS(uiFlush and close the IO object. This method has no effect if the file is already closed. NT(u_IOBase__closeduflushuTrue(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyucloseWs u IOBase.closec Csy|jWnYnXdS(uDestructor. Calls close().N(uclose(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__del__bsuIOBase.__del__cCsdS(uReturn a bool indicating whether object supports random access. If False, seek(), tell() and truncate() will raise UnsupportedOperation. This method may need to do a test seek(). F(uFalse(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuseekablepsuIOBase.seekablecCs1|js-t|dkr!dn|ndS(uEInternal: raise UnsupportedOperation if file is not seekable uFile or stream is not seekable.N(useekableuUnsupportedOperationuNone(uselfumsg((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu_checkSeekablexs uIOBase._checkSeekablecCsdS(uReturn a bool indicating whether object was opened for reading. If False, read() will raise UnsupportedOperation. F(uFalse(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadablesuIOBase.readablecCs1|js-t|dkr!dn|ndS(uEInternal: raise UnsupportedOperation if file is not readable uFile or stream is not readable.N(ureadableuUnsupportedOperationuNone(uselfumsg((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu_checkReadables uIOBase._checkReadablecCsdS(uReturn a bool indicating whether object was opened for writing. If False, write() and truncate() will raise UnsupportedOperation. F(uFalse(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwritablesuIOBase.writablecCs1|js-t|dkr!dn|ndS(uEInternal: raise UnsupportedOperation if file is not writable uFile or stream is not writable.N(uwritableuUnsupportedOperationuNone(uselfumsg((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu_checkWritables uIOBase._checkWritablecCs|jS(uclosed: bool. True iff the file has been closed. For backwards compatibility, this is a property, not a predicate. (u_IOBase__closed(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuclosedsu IOBase.closedcCs.|jr*t|dkrdn|ndS(u8Internal: raise an ValueError if file is closed uI/O operation on closed file.N(uclosedu ValueErroruNone(uselfumsg((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu _checkCloseds uIOBase._checkClosedcCs|j|S(uCContext management protocol. Returns self (an instance of IOBase).(u _checkClosed(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu __enter__s uIOBase.__enter__cGs|jdS(u+Context management protocol. Calls close()N(uclose(uselfuargs((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__exit__suIOBase.__exit__cCs|jddS(uReturns underlying file descriptor (an int) if one exists. An IOError is raised if the IO object does not use a file descriptor. ufilenoN(u _unsupported(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyufilenosu IOBase.filenocCs|jdS(u{Return a bool indicating whether this is an 'interactive' stream. Return False if it can't be determined. F(u _checkCloseduFalse(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuisattys u IOBase.isattyicstdr'fdd}n dd}d krHd nttsftdnt}x[dkst|krj|}|sPn||7}|jdrrPqrqrWt |S( uQRead and return a line of bytes from the stream. If limit is specified, at most limit bytes will be read. Limit should be an int. The line terminator is always b'\n' for binary files; for text files, the newlines argument to open can be used to select the line terminator(s) recognized. upeekcsZjd}|sdS|jddp5t|}dkrVt|}n|S(Nis i(upeekufindulenumin(u readaheadun(ulimituself(u*/opt/alt/python33/lib64/python3.3/_pyio.pyu nreadaheads u#IOBase.readline..nreadaheadcSsdS(Ni((((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu nreadaheadsiulimit must be an integeris Ni( uhasattruNoneu isinstanceuintu TypeErroru bytearrayulenureaduendswithubytes(uselfulimitu nreadaheaduresub((ulimituselfu*/opt/alt/python33/lib64/python3.3/_pyio.pyureadlines     ! uIOBase.readlinecCs|j|S(N(u _checkClosed(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__iter__s uIOBase.__iter__cCs|j}|stn|S(N(ureadlineu StopIteration(uselfuline((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__next__s  uIOBase.__next__cCsp|dks|dkr"t|Sd}g}x;|D]3}|j||t|7}||kr5Pq5q5W|S(uReturn a list of lines from the stream. hint can be specified to control the number of lines read: no more lines will be read if the total size (in bytes/characters) of all lines so far exceeds hint. iN(uNoneulistuappendulen(uselfuhintunulinesuline((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu readliness    uIOBase.readlinescCs,|jx|D]}|j|qWdS(N(u _checkCloseduwrite(uselfulinesuline((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu writelines s  uIOBase.writelinesNFi( u__name__u __module__u __qualname__u__doc__u _unsupporteduseekutelluNoneutruncateuflushuFalseu_IOBase__closeducloseu__del__useekableu_checkSeekableureadableu_checkReadableuwritableu_checkWritableupropertyuclosedu _checkClosedu __enter__u__exit__ufilenouisattyureadlineu__iter__u__next__u readlinesu writelines(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuIOBases4           %  uIOBaseu metaclasscBsM|EeZdZdZd ddZddZddZd d Zd S( u RawIOBaseuBase class for raw binary I/O.icCss|dkrd}n|dkr+|jSt|j}|j|}|dkr\dS||d=t|S(uRead and return up to n bytes, where n is an int. Returns an empty bytes object on EOF, or None if the object is set not to block and has no data to read. iiNi(uNoneureadallu bytearrayu __index__ureadintoubytes(uselfunub((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuread!s      uRawIOBase.readcCsJt}x&|jt}|s%Pn||7}q |rBt|S|SdS(u+Read until EOF, using multiple read() call.N(u bytearrayureaduDEFAULT_BUFFER_SIZEubytes(uselfuresudata((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadall2s   uRawIOBase.readallcCs|jddS(uRead up to len(b) bytes into bytearray b. Returns an int representing the number of bytes read (0 for EOF), or None if the object is set not to block and has no data to read. ureadintoN(u _unsupported(uselfub((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadinto@suRawIOBase.readintocCs|jddS(u~Write the given buffer to the IO stream. Returns the number of bytes written, which may be less than len(b). uwriteN(u _unsupported(uselfub((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwriteHsuRawIOBase.writeNi(u__name__u __module__u __qualname__u__doc__ureadureadallureadintouwrite(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu RawIOBases    u RawIOBase(uFileIOcBs\|EeZdZdZd ddZd ddZddZdd Zd d Z d S( uBufferedIOBaseuBase class for buffered IO objects. The main difference with RawIOBase is that the read() method supports omitting the size argument, and does not have a default implementation that defers to readinto(). In addition, read(), readinto() and write() may raise BlockingIOError if the underlying raw stream is in non-blocking mode and not ready; unlike their raw counterparts, they will never return None. A typical implementation should not inherit from a RawIOBase implementation, but wrap one. cCs|jddS(uRead and return up to n bytes, where n is an int. If the argument is omitted, None, or negative, reads and returns all data until EOF. If the argument is positive, and the underlying raw stream is not 'interactive', multiple raw reads may be issued to satisfy the byte count (unless EOF is reached first). But for interactive raw streams (XXX and for pipes?), at most one raw read will be issued, and a short result does not imply that EOF is imminent. Returns an empty bytes array on EOF. Raises BlockingIOError if the underlying raw stream has no data at the moment. ureadN(u _unsupported(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadesuBufferedIOBase.readcCs|jddS(u[Read up to n bytes with at most one read() system call, where n is an int. uread1N(u _unsupported(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuread1ysuBufferedIOBase.read1cCs|jt|}t|}y||d||jdkrtdn|j|j}d|_|S(Nuraw stream already detached(urawuNoneu ValueErroruflushu_raw(uselfuraw((u*/opt/alt/python33/lib64/python3.3/_pyio.pyudetachs    u_BufferedIOMixin.detachcCs |jjS(N(urawuseekable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuseekablesu_BufferedIOMixin.seekablecCs |jjS(N(urawureadable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadablesu_BufferedIOMixin.readablecCs |jjS(N(urawuwritable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwritablesu_BufferedIOMixin.writablecCs|jS(N(u_raw(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyurawsu_BufferedIOMixin.rawcCs |jjS(N(urawuclosed(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuclosedsu_BufferedIOMixin.closedcCs |jjS(N(urawuname(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyunamesu_BufferedIOMixin.namecCs |jjS(N(urawumode(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyumodesu_BufferedIOMixin.modecCstdj|jjdS(Nu can not serialize a '{0}' object(u TypeErroruformatu __class__u__name__(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu __getstate__s u_BufferedIOMixin.__getstate__c CsO|jj}y |j}Wntk r:dj|SYnXdj||SdS(Nu <_pyio.{0}>u<_pyio.{0} name={1!r}>(u __class__u__name__unameuAttributeErroruformat(uselfuclsnameuname((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__repr__ s    u_BufferedIOMixin.__repr__cCs |jjS(N(urawufileno(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyufilenosu_BufferedIOMixin.filenocCs |jjS(N(urawuisatty(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuisattysu_BufferedIOMixin.isattyN(u__name__u __module__u __qualname__u__doc__u__init__useekutelluNoneutruncateuflushucloseudetachuseekableureadableuwritableupropertyurawuclosedunameumodeu __getstate__u__repr__ufilenouisatty(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu_BufferedIOMixins&         u_BufferedIOMixincBs|EeZdZdZdddZddZddZdd Zdd d Z d d Z ddZ dddZ ddZ dddZddZddZddZdS(uBytesIOu<Buffered I/O implementation using an in-memory bytes buffer.cCs8t}|dk r"||7}n||_d|_dS(Ni(u bytearrayuNoneu_bufferu_pos(uselfu initial_bytesubuf((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__init__s     uBytesIO.__init__cCs%|jrtdn|jjS(Nu__getstate__ on closed file(uclosedu ValueErroru__dict__ucopy(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu __getstate__&s uBytesIO.__getstate__cCs%|jrtdnt|jS(u8Return the bytes value (contents) of the buffer ugetvalue on closed file(uclosedu ValueErrorubytesu_buffer(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyugetvalue+s uBytesIO.getvaluecCs t|jS(u;Return a readable and writable view of the buffer. (u memoryviewu_buffer(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu getbuffer2suBytesIO.getbuffercCs|jrtdn|dkr-d}n|dkrKt|j}nt|j|jkrgdStt|j|j|}|j|j|}||_t|S(Nuread from closed fileiisi(uclosedu ValueErroruNoneulenu_bufferu_posuminubytes(uselfununewposub((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuread7s     u BytesIO.readcCs |j|S(u"This is the same as read. (uread(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuread1Esu BytesIO.read1cCs|jrtdnt|tr6tdnt|}|dkrRdS|j}|t|jkrd|t|j}|j|7_n||j|||<|j|7_|S(Nuwrite to closed fileu can't write str to binary streamis(uclosedu ValueErroru isinstanceustru TypeErrorulenu_posu_buffer(uselfubunuposupadding((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwriteJs    u BytesIO.writeicCs|jrtdny |jWn4tk rY}ztd|WYdd}~XnX|dkr|dkrtd|fn||_nb|dkrtd|j||_n:|dkrtdt|j||_n td|jS(Nuseek on closed fileuan integer is requirediunegative seek position %riiuunsupported whence value( uclosedu ValueErroru __index__uAttributeErroru TypeErroru_posumaxulenu_buffer(uselfuposuwhenceuerr((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuseek\s   "     " u BytesIO.seekcCs|jrtdn|jS(Nutell on closed file(uclosedu ValueErroru_pos(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutellos u BytesIO.tellcCs|jrtdn|dkr0|j}ndy |jWn4tk rq}ztd|WYdd}~XnX|dkrtd|fn|j|d=|S(Nutruncate on closed fileuan integer is requirediunegative truncate position %r(uclosedu ValueErroruNoneu_posu __index__uAttributeErroru TypeErroru_buffer(uselfuposuerr((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutruncatets    " uBytesIO.truncatecCs|jrtdndS(NuI/O operation on closed file.T(uclosedu ValueErroruTrue(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadables uBytesIO.readablecCs|jrtdndS(NuI/O operation on closed file.T(uclosedu ValueErroruTrue(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwritables uBytesIO.writablecCs|jrtdndS(NuI/O operation on closed file.T(uclosedu ValueErroruTrue(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuseekables uBytesIO.seekableN(u__name__u __module__u __qualname__u__doc__uNoneu__init__u __getstate__ugetvalueu getbufferureaduread1uwriteuseekutellutruncateureadableuwritableuseekable(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuBytesIOs        uBytesIOcBs|EeZdZdZeddZddZdddZddd Z d d d Z d d dZ ddZ ddZ d ddZdS(uBufferedReaderuBufferedReader(raw[, buffer_size]) A buffer for a readable, sequential BaseRawIO object. The constructor creates a BufferedReader for the given readable raw stream and buffer_size. If buffer_size is omitted, DEFAULT_BUFFER_SIZE is used. cCsi|jstdntj|||dkrFtdn||_|jt|_dS(uMCreate a new buffered reader using the given readable raw IO object. u "raw" argument must be readable.iuinvalid buffer sizeN( ureadableuIOErroru_BufferedIOMixinu__init__u ValueErroru buffer_sizeu_reset_read_bufuLocku _read_lock(uselfurawu buffer_size((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__init__s    uBufferedReader.__init__cCsd|_d|_dS(Nsi(u _read_bufu _read_pos(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu_reset_read_bufs uBufferedReader._reset_read_bufc CsH|dk r'|dkr'tdn|j|j|SWdQXdS(uRead n bytes. Returns exactly n bytes of data unless the underlying raw IO stream reaches EOF or if the call would block in non-blocking mode. If n is negative, read until EOF or until read() would block. iuinvalid number of bytes to readNi(uNoneu ValueErroru _read_locku_read_unlocked(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureads uBufferedReader.readc CsNd}d}|j}|j}|dks6|dkr&|jt|jdr|jj}|dkr||dpdS||d|Sn||dg}d}xay|jj}Wntk rwYnX||kr|}Pn|t |7}|j |qdj |p%|St ||} || krc|j|7_||||S||dg}t |j |} xq| |kry|jj| }Wntk rwYnX||kr|}Pn| t |7} |j |qWt|| }dj |} | |d|_d|_| rJ| d|S|S(Nsiureadalli(sNi(uNoneu _read_bufu _read_posu_reset_read_bufuhasattrurawureadallureaduInterruptedErrorulenuappendujoinumaxu buffer_sizeumin( uselfunu nodata_valu empty_valuesubufuposuchunkuchunksu current_sizeuavailuwanteduout((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu_read_unlockedsZ          uBufferedReader._read_unlockedic Cs!|j|j|SWdQXdS(uReturns buffered bytes without advancing the position. The argument indicates a desired minimal number of bytes; we do at most one raw read to satisfy it. We never return more than self.buffer_size. N(u _read_locku_peek_unlocked(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyupeeks uBufferedReader.peekc Cst||j}t|j|j}||ks@|dkr|j|}x2y|jj|}Wntk r}wPYnXPqP|r|j|jd||_d|_qn|j|jdS(Ni(uminu buffer_sizeulenu _read_bufu _read_posurawureaduInterruptedError(uselfunuwantuhaveuto_readucurrent((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu_peek_unlockeds  uBufferedReader._peek_unlockedc Csr|dkrtdn|dkr+dS|j8|jd|jt|t|j|jSWdQXdS(u9Reads up to n bytes, with at most one read() system call.iu(number of bytes to read must be positivesiN(u ValueErroru _read_locku_peek_unlockedu_read_unlockeduminulenu _read_bufu _read_pos(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuread1s    uBufferedReader.read1cCs!tj|t|j|jS(N(u_BufferedIOMixinutellulenu _read_bufu _read_pos(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutellsuBufferedReader.tellc Cs{|tkrtdn|jQ|dkrN|t|j|j8}ntj|||}|j|SWdQXdS(Nuinvalid whence valuei( uvalid_seek_flagsu ValueErroru _read_lockulenu _read_bufu _read_posu_BufferedIOMixinuseeku_reset_read_buf(uselfuposuwhence((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuseek s    uBufferedReader.seekN(u__name__u __module__u __qualname__u__doc__uDEFAULT_BUFFER_SIZEu__init__u_reset_read_bufuNoneureadu_read_unlockedupeeku_peek_unlockeduread1utelluseek(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuBufferedReaders   :  uBufferedReadercBsw|EeZdZdZeddZddZdddZdd Z d d Z d d Z dddZ dS(uBufferedWriteruA buffer for a writeable sequential RawIO object. The constructor creates a BufferedWriter for the given writeable raw stream. If the buffer_size is not given, it defaults to DEFAULT_BUFFER_SIZE. cCsk|jstdntj|||dkrFtdn||_t|_t|_ dS(Nu "raw" argument must be writable.iuinvalid buffer size( uwritableuIOErroru_BufferedIOMixinu__init__u ValueErroru buffer_sizeu bytearrayu _write_bufuLocku _write_lock(uselfurawu buffer_size((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__init__3s    uBufferedWriter.__init__cCsb|jrtdnt|tr6tdn|jt|j|jkre|j nt|j}|jj |t|j|}t|j|jkrTy|j WqTt k rP}zqt|j|jkr>t|j|j}||8}|jd|j|_t |j |j |nWYdd}~XqTXn|SWdQXdS(Nuwrite to closed fileu can't write str to binary stream(uclosedu ValueErroru isinstanceustru TypeErroru _write_lockulenu _write_bufu buffer_sizeu_flush_unlockeduextenduBlockingIOErroruerrnoustrerror(uselfububeforeuwrittenueuoverage((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwrite>s(    1uBufferedWriter.writec CsL|j=|j|dkr2|jj}n|jj|SWdQXdS(N(u _write_locku_flush_unlockeduNoneurawutellutruncate(uselfupos((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutruncateZs    uBufferedWriter.truncatecCs|j|jWdQXdS(N(u _write_locku_flush_unlocked(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuflushas uBufferedWriter.flushc Cs|jrtdnx|jry|jj|j}Wn2tk rTwYntk rqtdYnX|dkrtt j ddn|t |jks|dkrt dn|jd|=qWdS(Nuflush of closed fileuHself.raw should implement RawIOBase: it should not raise BlockingIOErroru)write could not complete without blockingiu*write() returned incorrect number of bytes( uclosedu ValueErroru _write_bufurawuwriteuInterruptedErroruBlockingIOErroru RuntimeErroruNoneuerrnouEAGAINulenuIOError(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu_flush_unlockedes      !uBufferedWriter._flush_unlockedcCstj|t|jS(N(u_BufferedIOMixinutellulenu _write_buf(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutellxsuBufferedWriter.tellic CsL|tkrtdn|j"|jtj|||SWdQXdS(Nuinvalid whence value(uvalid_seek_flagsu ValueErroru _write_locku_flush_unlockedu_BufferedIOMixinuseek(uselfuposuwhence((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuseek{s    uBufferedWriter.seekN( u__name__u __module__u __qualname__u__doc__uDEFAULT_BUFFER_SIZEu__init__uwriteuNoneutruncateuflushu_flush_unlockedutelluseek(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuBufferedWriter*s    uBufferedWritercBs|EeZdZdZeddZdddZddZdd Z d d d Z d dZ ddZ ddZ ddZddZddZeddZdS(uBufferedRWPairuA buffered reader and writer object together. A buffered reader object and buffered writer object put together to form a sequential IO object that can read and write. This is typically used with a socket or two-way pipe. reader and writer are RawIOBase objects that are readable and writeable respectively. If the buffer_size is omitted it defaults to DEFAULT_BUFFER_SIZE. cCs^|jstdn|js6tdnt|||_t|||_dS(uEConstructor. The arguments are two RawIO instances. u#"reader" argument must be readable.u#"writer" argument must be writable.N(ureadableuIOErroruwritableuBufferedReaderureaderuBufferedWriteruwriter(uselfureaderuwriteru buffer_size((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__init__s   uBufferedRWPair.__init__cCs%|dkrd}n|jj|S(Nii(uNoneureaderuread(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureads  uBufferedRWPair.readcCs|jj|S(N(ureaderureadinto(uselfub((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadintosuBufferedRWPair.readintocCs|jj|S(N(uwriteruwrite(uselfub((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwritesuBufferedRWPair.writeicCs|jj|S(N(ureaderupeek(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyupeeksuBufferedRWPair.peekcCs|jj|S(N(ureaderuread1(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuread1suBufferedRWPair.read1cCs |jjS(N(ureaderureadable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadablesuBufferedRWPair.readablecCs |jjS(N(uwriteruwritable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwritablesuBufferedRWPair.writablecCs |jjS(N(uwriteruflush(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuflushsuBufferedRWPair.flushcCs|jj|jjdS(N(uwriterucloseureader(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyucloses uBufferedRWPair.closecCs|jjp|jjS(N(ureaderuisattyuwriter(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuisattysuBufferedRWPair.isattycCs |jjS(N(uwriteruclosed(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuclosedsuBufferedRWPair.closedN(u__name__u __module__u __qualname__u__doc__uDEFAULT_BUFFER_SIZEu__init__uNoneureadureadintouwriteupeekuread1ureadableuwritableuflushucloseuisattyupropertyuclosed(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuBufferedRWPairs         uBufferedRWPaircBs|EeZdZdZeddZdddZddZdd d Z dd d Z d dZ dddZ ddZ ddZdS(uBufferedRandomuA buffered interface to random access streams. The constructor creates a reader and writer for a seekable stream, raw, given in the first argument. If the buffer_size is omitted it defaults to DEFAULT_BUFFER_SIZE. cCs4|jtj|||tj|||dS(N(u_checkSeekableuBufferedReaderu__init__uBufferedWriter(uselfurawu buffer_size((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__init__s uBufferedRandom.__init__icCs|tkrtdn|j|jrd|j(|jj|jt|jdWdQXn|jj||}|j|j WdQX|dkrt dn|S(Nuinvalid whence valueiiu seek() returned invalid position( uvalid_seek_flagsu ValueErroruflushu _read_bufu _read_lockurawuseeku _read_posulenu_reset_read_bufuIOError(uselfuposuwhence((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuseeks    ,  uBufferedRandom.seekcCs'|jrtj|Stj|SdS(N(u _write_bufuBufferedWriterutelluBufferedReader(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutells  uBufferedRandom.tellcCs+|dkr|j}ntj||S(N(uNoneutelluBufferedWriterutruncate(uselfupos((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutruncates uBufferedRandom.truncatecCs/|dkrd}n|jtj||S(Nii(uNoneuflushuBufferedReaderuread(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureads   uBufferedRandom.readcCs|jtj||S(N(uflushuBufferedReaderureadinto(uselfub((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadintos uBufferedRandom.readintocCs|jtj||S(N(uflushuBufferedReaderupeek(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyupeeks uBufferedRandom.peekcCs|jtj||S(N(uflushuBufferedReaderuread1(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuread1s uBufferedRandom.read1c CsY|jrI|j2|jj|jt|jd|jWdQXntj||S(Ni( u _read_bufu _read_lockurawuseeku _read_posulenu_reset_read_bufuBufferedWriteruwrite(uselfub((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwrites   #uBufferedRandom.writeN(u__name__u __module__u __qualname__u__doc__uDEFAULT_BUFFER_SIZEu__init__useekutelluNoneutruncateureadureadintoupeekuread1uwrite(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuBufferedRandoms   uBufferedRandomcBs|EeZdZdZdddZddZdddZd d Zd d Z e d dZ e ddZ e ddZ dS(u TextIOBaseuBase class for text I/O. This class provides a character and line based interface to stream I/O. There is no readinto method because Python's character strings are immutable. There is no public constructor. icCs|jddS(uRead at most n characters from stream, where n is an int. Read from underlying buffer until we have n characters or we hit EOF. If n is negative or omitted, read until EOF. Returns a string. ureadN(u _unsupported(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadsuTextIOBase.readcCs|jddS(u.Write string s to stream and returning an int.uwriteN(u _unsupported(uselfus((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwrite suTextIOBase.writecCs|jddS(u*Truncate size to pos, where pos is an int.utruncateN(u _unsupported(uselfupos((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutruncate$suTextIOBase.truncatecCs|jddS(u_Read until newline or EOF. Returns an empty string if EOF is hit immediately. ureadlineN(u _unsupported(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadline(suTextIOBase.readlinecCs|jddS(u Separate the underlying buffer from the TextIOBase and return it. After the underlying buffer has been detached, the TextIO is in an unusable state. udetachN(u _unsupported(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyudetach/suTextIOBase.detachcCsdS(uSubclasses should override.N(uNone(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuencoding8suTextIOBase.encodingcCsdS(uLine endings translated so far. Only line endings translated during reading are considered. Subclasses should override. N(uNone(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyunewlines=suTextIOBase.newlinescCsdS(uMError setting of the decoder or encoder. Subclasses should override.N(uNone(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuerrorsGsuTextIOBase.errorsNi(u__name__u __module__u __qualname__u__doc__ureaduwriteuNoneutruncateureadlineudetachupropertyuencodingunewlinesuerrors(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu TextIOBase s    u TextIOBasecBs|EeZdZdZdddZdddZddZd d Zd d Z d Z dZ dZ e ddZdS(uIncrementalNewlineDecoderu+Codec used when reading a file in universal newlines mode. It wraps another incremental decoder, translating \r\n and \r into \n. It also records the types of newlines encountered. When used with translate=False, it ensures that the newline sequence is returned in one piece. ustrictcCs>tjj|d|||_||_d|_d|_dS(NuerrorsiF(ucodecsuIncrementalDecoderu__init__u translateudecoderuseennluFalseu pendingcr(uselfudecoderu translateuerrors((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__init__Xs    u"IncrementalNewlineDecoder.__init__c Cs:|jdkr|}n|jj|d|}|jr[|sE|r[d|}d|_n|jdr| r|dd}d|_n|jd}|jd|}|jd|}|j|o|j |o|j B|o|j BO_|j r6|r|j dd}n|r6|j dd}q6n|S( Nufinalu iu u FiT(udecoderuNoneudecodeu pendingcruFalseuendswithuTrueucountuseennlu_LFu_CRu_CRLFu translateureplace(uselfuinputufinaluoutputucrlfucrulf((u*/opt/alt/python33/lib64/python3.3/_pyio.pyudecode_s(    + u IncrementalNewlineDecoder.decodecCs]|jdkrd}d}n|jj\}}|dK}|jrS|dO}n||fS(Nsii(udecoderuNoneugetstateu pendingcr(uselfubufuflag((u*/opt/alt/python33/lib64/python3.3/_pyio.pyugetstate~s    u"IncrementalNewlineDecoder.getstatecCsO|\}}t|d@|_|jdk rK|jj||d?fndS(Ni(uboolu pendingcrudecoderuNoneusetstate(uselfustateubufuflag((u*/opt/alt/python33/lib64/python3.3/_pyio.pyusetstates u"IncrementalNewlineDecoder.setstatecCs5d|_d|_|jdk r1|jjndS(NiF(useennluFalseu pendingcrudecoderuNoneureset(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuresets  uIncrementalNewlineDecoder.resetiiic Cs d|jS( Nu u u (u u (u u (u u (u u u (Nu u (u u u (u u (u u (u u u (uNoneuseennl(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyunewlinessu"IncrementalNewlineDecoder.newlinesNF(u__name__u __module__u __qualname__u__doc__u__init__uFalseudecodeugetstateusetstateuresetu_LFu_CRu_CRLFupropertyunewlines(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuIncrementalNewlineDecoderQs  uIncrementalNewlineDecodercBs|EeZdZdZdZdDdDdDdEdEddZddZe ddZ e d d Z e d d Z e d dZ ddZddZddZddZddZe ddZe ddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(ZdDd)d*Zd+d,Zd-d.Zd/d/d/d/d0d1Zd2d3Zd4d5Z dDd6d7Z!d8d9Z"d/d:d;Z#dDd<d=Z$d>d?Z%dDd@dAZ&e dBdCZ'dDS(Fu TextIOWrapperuCharacter and line based layer over a BufferedIOBase object, buffer. encoding gives the name of the encoding that the stream will be decoded or encoded with. It defaults to locale.getpreferredencoding(False). errors determines the strictness of encoding and decoding (see the codecs.register) and defaults to "strict". newline can be None, '', '\n', '\r', or '\r\n'. It controls the handling of line endings. If it is None, universal newlines is enabled. With this enabled, on input, the lines endings '\n', '\r', or '\r\n' are translated to '\n' before being returned to the caller. Conversely, on output, '\n' is translated to the system default line separator, os.linesep. If newline is any other of its legal values, that newline becomes the newline when the file is read and it is returned untranslated. On output, '\n' is converted to the newline. If line_buffering is True, a call to flush is implied when a call to write contains a newline character. ic Cs|dk r8t|t r8tdt|fn|dkrZtd|fn|dkrytj|j}Wnt t fk rYnX|dkryddl }Wnt k rd}YqX|j d}qnt|tstd |ntj|js3d }t||n|dkrHd }n"t|tsjtd |n||_||_||_||_| |_|dk|_||_|dk|_|ptj|_d|_d|_d|_d|_ d|_!|j"j#|_$|_%t&|j"d |_'d|_(|j$r|j)r|j"j*} | dkry|j+j,dWqtk rYqXqndS(Nuillegal newline type: %ruu u u uillegal newline value: %riuasciiuinvalid encoding: %ruG%r is not a text encoding; use codecs.open() to handle arbitrary codecsustrictuinvalid errors: %ruread1g(Nuu u u F(-uNoneu isinstanceustru TypeErrorutypeu ValueErroruosudevice_encodingufilenouAttributeErroruUnsupportedOperationulocaleu ImportErrorugetpreferredencodinguFalseucodecsulookupu_is_text_encodingu LookupErroru_bufferu_line_bufferingu _encodingu_errorsu_readuniversalu_readtranslateu_readnlu_writetranslateulinesepu_writenlu_encoderu_decoderu_decoded_charsu_decoded_chars_usedu _snapshotubufferuseekableu _seekableu_tellinguhasattru _has_read1u _b2cratiouwritableutellu _get_encoderusetstate( uselfubufferuencodinguerrorsunewlineuline_bufferingu write_throughulocaleumsguposition((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__init__s`                     uTextIOWrapper.__init__cCsd}y |j}Wntk r'YnX|dj|7}y |j}Wntk r\YnX|dj|7}|dj|jS(Nu<_pyio.TextIOWrapperu name={0!r}u mode={0!r}u encoding={0!r}>(unameuAttributeErroruformatumodeuencoding(uselfuresultunameumode((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__repr__ s    uTextIOWrapper.__repr__cCs|jS(N(u _encoding(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuencodingsuTextIOWrapper.encodingcCs|jS(N(u_errors(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuerrorssuTextIOWrapper.errorscCs|jS(N(u_line_buffering(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuline_buffering!suTextIOWrapper.line_bufferingcCs|jS(N(u_buffer(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyubuffer%suTextIOWrapper.buffercCs|jrtdn|jS(NuI/O operation on closed file.(uclosedu ValueErroru _seekable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuseekable)s uTextIOWrapper.seekablecCs |jjS(N(ubufferureadable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadable.suTextIOWrapper.readablecCs |jjS(N(ubufferuwritable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwritable1suTextIOWrapper.writablecCs|jj|j|_dS(N(ubufferuflushu _seekableu_telling(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuflush4s uTextIOWrapper.flushc Cs?|jdk r;|j r;z|jWd|jjXndS(N(ubufferuNoneucloseduflushuclose(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuclose8suTextIOWrapper.closecCs |jjS(N(ubufferuclosed(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuclosed?suTextIOWrapper.closedcCs |jjS(N(ubufferuname(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyunameCsuTextIOWrapper.namecCs |jjS(N(ubufferufileno(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyufilenoGsuTextIOWrapper.filenocCs |jjS(N(ubufferuisatty(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuisattyJsuTextIOWrapper.isattyc Cs"|jrtdnt|ts@td|jjnt|}|js^|j ogd|k}|r|jr|j dkr|j d|j }n|j p|j }|j|}|jj||j r|sd|kr|jnd|_|jr|jjn|S(uWrite data, where s is a struwrite to closed fileucan't write %s to text streamu u N(uclosedu ValueErroru isinstanceustru TypeErroru __class__u__name__ulenu_writetranslateu_line_bufferingu_writenlureplaceu_encoderu _get_encoderuencodeubufferuwriteuflushuNoneu _snapshotu_decoderureset(uselfusulengthuhaslfuencoderub((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwriteMs$     uTextIOWrapper.writecCs+tj|j}||j|_|jS(N(ucodecsugetincrementalencoderu _encodingu_errorsu_encoder(uselfu make_encoder((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu _get_encodercsuTextIOWrapper._get_encodercCsLtj|j}||j}|jr?t||j}n||_|S(N(ucodecsugetincrementaldecoderu _encodingu_errorsu_readuniversaluIncrementalNewlineDecoderu_readtranslateu_decoder(uselfu make_decoderudecoder((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu _get_decoderhs   uTextIOWrapper._get_decodercCs||_d|_dS(uSet the _decoded_chars buffer.iN(u_decoded_charsu_decoded_chars_used(uselfuchars((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu_set_decoded_charsss u TextIOWrapper._set_decoded_charscCs[|j}|dkr+|j|d}n|j|||}|jt|7_|S(u'Advance into the _decoded_chars buffer.N(u_decoded_chars_useduNoneu_decoded_charsulen(uselfunuoffsetuchars((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu_get_decoded_charsxs   u TextIOWrapper._get_decoded_charscCs1|j|krtdn|j|8_dS(u!Rewind the _decoded_chars buffer.u"rewind decoded_chars out of boundsN(u_decoded_chars_useduAssertionError(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu_rewind_decoded_charssu#TextIOWrapper._rewind_decoded_charscCs|jdkrtdn|jr?|jj\}}n|jr`|jj|j}n|jj |j}| }|jj ||}|j ||rt |t |j |_n d|_|jr|||f|_n| S(uQ Read and decode the next chunk of data from the BufferedReader. u no decodergN(u_decoderuNoneu ValueErroru_tellingugetstateu _has_read1ubufferuread1u _CHUNK_SIZEureadudecodeu_set_decoded_charsulenu_decoded_charsu _b2cratiou _snapshot(uselfu dec_bufferu dec_flagsu input_chunkueofu decoded_chars((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu _read_chunks      uTextIOWrapper._read_chunkicCs*||d>B|d>B|d>Bt|d>BS(Ni@iii(ubool(uselfupositionu dec_flagsu bytes_to_feeduneed_eofu chars_to_skip((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu _pack_cookiesuTextIOWrapper._pack_cookiecCsgt|d\}}t|d\}}t|d\}}t|d\}}|||||fS(Nii@llll(udivmod(uselfubiginturestupositionu dec_flagsu bytes_to_feeduneed_eofu chars_to_skip((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu_unpack_cookies uTextIOWrapper._unpack_cookiecCs.|jstdn|js0tdn|j|jj}|j}|dksm|j dkr|j rt dn|S|j \}}|t |8}|j }|dkr|j||S|j}z@t|j|}d}|t |ks t x|dkr|jd|ft |j|d|} | |kr|j\} } | s| }|| 8}Pn|t | 8}d}q||8}|d}qWd}|jd|f||} |} |dkr|j| | Sd}d}d}xt|t |D]}|d7}|t |j|||d7}|j\}}| r||kr| |7} ||8}|dd} }}n||kr$Pq$q$W|t |jddd 7}d}||krtd n|j| | |||SWd|j|XdS( Nu!underlying stream is not seekableu(telling position disabled by next() callupending decoded textiisiufinalu'can't reconstruct logical file positionT(u _seekableuUnsupportedOperationu_tellinguIOErroruflushubufferutellu_decoderuNoneu _snapshotu_decoded_charsuAssertionErrorulenu_decoded_chars_usedu _pack_cookieugetstateuintu _b2cratiousetstateudecodeurangeuTrue(uselfupositionudecoderu dec_flagsu next_inputu chars_to_skipu saved_stateu skip_bytesu skip_backunubudu start_posu start_flagsu bytes_feduneed_eofu chars_decodeduiu dec_buffer((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutellsx               '    uTextIOWrapper.tellcCs5|j|dkr%|j}n|jj|S(N(uflushuNoneutellubufferutruncate(uselfupos((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutruncate&s  uTextIOWrapper.truncatecCs>|jdkrtdn|j|j}d|_|S(Nubuffer is already detached(ubufferuNoneu ValueErroruflushu_buffer(uselfubuffer((u*/opt/alt/python33/lib64/python3.3/_pyio.pyudetach,s    uTextIOWrapper.detachc Cs|jrtdn|js0tdn|dkrl|dkrWtdnd}|j}n|dkr|dkrtdn|j|jjdd}|jdd|_ |j r|j j n|S|dkrtd |fn|dkr)td |fn|j|j |\}}}}}|jj||jdd|_ |dkr|j r|j j nU|j s|s|r|j p|j|_ |j jd |f|d f|_ n|rd|jj|} |j|j j| ||| f|_ t|j|krXtd n||_ny|jpy|j} Wntk rYn'X|dkr| jdn | j |S( Nutell on closed fileu!underlying stream is not seekableiiu#can't do nonzero cur-relative seeksiu#can't do nonzero end-relative seeksuuunsupported whence (%r)unegative seek position %rsu#can't restore logical file position(uclosedu ValueErroru _seekableuUnsupportedOperationutelluflushubufferuseeku_set_decoded_charsuNoneu _snapshotu_decoderuresetu_unpack_cookieu _get_decoderusetstateureadudecodeulenu_decoded_charsuIOErroru_decoded_chars_usedu_encoderu _get_encoderu LookupError( uselfucookieuwhenceupositionu start_posu dec_flagsu bytes_to_feeduneed_eofu chars_to_skipu input_chunkuencoder((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuseek4sd                   uTextIOWrapper.seekcCs+|j|dkrd}n|jp1|j}y |jWn4tk ru}ztd|WYdd}~XnX|dkr|j|j|j j dd}|j dd|_ |Sd}|j|}xGt||kr"| r"|j }||j|t|7}qW|SdS( Niuan integer is requirediufinaluiTF(u_checkReadableuNoneu_decoderu _get_decoderu __index__uAttributeErroru TypeErroru_get_decoded_charsudecodeubufferureaduTrueu_set_decoded_charsu _snapshotuFalseulenu _read_chunk(uselfunudecoderuerruresultueof((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuread{s(    "     !uTextIOWrapper.readcCs=d|_|j}|s9d|_|j|_tn|S(NF(uFalseu_tellingureadlineuNoneu _snapshotu _seekableu StopIteration(uselfuline((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__next__s     uTextIOWrapper.__next__cCs|jrtdn|dkr-d }nt|tsKtdn|j}d}|jss|jnd}}x|j r|j d|}|dkr|d}Pqt |}n|j r|j d|}|j d|}|d kr&|d krt |}q|d}Pq|d kr@|d}Pq||krZ|d}Pq||dkrx|d}Pq|d}Pn5|j |j }|dkr|t |j }Pn|dkrt ||kr|}Pnx|jr|jrPqqW|jr||j7}q|jdd|_|Sq|dkr]||kr]|}n|jt |||d|S( Nuread from closed fileiulimit must be an integeriu u iuiiii(uclosedu ValueErroruNoneu isinstanceuintu TypeErroru_get_decoded_charsu_decoderu _get_decoderu_readtranslateufindulenu_readuniversalu_readnlu _read_chunku_decoded_charsu_set_decoded_charsu _snapshotu_rewind_decoded_chars(uselfulimitulineustartuposuendposunlposucrpos((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadlinesp                          uTextIOWrapper.readlinecCs|jr|jjSdS(N(u_decoderunewlinesuNone(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyunewlinessuTextIOWrapper.newlinesNF((u__name__u __module__u __qualname__u__doc__u _CHUNK_SIZEuNoneuFalseu__init__u__repr__upropertyuencodinguerrorsuline_bufferingubufferuseekableureadableuwritableuflushucloseuclosedunameufilenouisattyuwriteu _get_encoderu _get_decoderu_set_decoded_charsu_get_decoded_charsu_rewind_decoded_charsu _read_chunku _pack_cookieu_unpack_cookieutellutruncateudetachuseekureadu__next__ureadlineunewlines(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu TextIOWrappersH E             *  c G Xu TextIOWrappercsz|EeZdZdZddfddZddZdd Zed d Zed d Z ddZ S(uStringIOuText I/O implementation using an in-memory buffer. The initial_value argument sets the value of object. The newline argument is like the one of TextIOWrapper's constructor. uu cstt|jtddddd||dkrCd|_n|dk rt|tst dj t |j t|}n|j ||jdndS( Nuencodinguutf-8uerrorsu surrogatepassunewlineu*initial_value must be str or None, not {0}iF(usuperuStringIOu__init__uBytesIOuNoneuFalseu_writetranslateu isinstanceustru TypeErroruformatutypeu__name__uwriteuseek(uselfu initial_valueunewline(u __class__(u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__init__s     uStringIO.__init__c Csj|j|jp|j}|j}|jz |j|jjddSWd|j |XdS(NufinalT( uflushu_decoderu _get_decoderugetstateuresetudecodeubufferugetvalueuTrueusetstate(uselfudecoderu old_state((u*/opt/alt/python33/lib64/python3.3/_pyio.pyugetvalues    uStringIO.getvaluecCs tj|S(N(uobjectu__repr__(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__repr__suStringIO.__repr__cCsdS(N(uNone(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuerrors!suStringIO.errorscCsdS(N(uNone(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuencoding%suStringIO.encodingcCs|jddS(Nudetach(u _unsupported(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyudetach)suStringIO.detach( u__name__u __module__u __qualname__u__doc__u__init__ugetvalueu__repr__upropertyuerrorsuencodingudetach(u __locals__((u __class__u*/opt/alt/python33/lib64/python3.3/_pyio.pyuStringIOs uStringIO(1u__doc__uosuabcucodecsuerrnou_threadu allocate_lockuLocku ImportErroru _dummy_threaduiou__all__uSEEK_SETuSEEK_CURuSEEK_ENDuvalid_seek_flagsuhasattruaddu SEEK_HOLEu SEEK_DATAuDEFAULT_BUFFER_SIZEuBlockingIOErroruNoneuTrueuopenu DocDescriptoru OpenWrapperuUnsupportedOperationuAttributeErroru ValueErroruIOErroruABCMetauIOBaseuregisteru RawIOBaseu_iouFileIOuBufferedIOBaseu_BufferedIOMixinuBytesIOuBufferedReaderuBufferedWriteruBufferedRWPairuBufferedRandomu TextIOBaseuIncrementalDecoderuIncrementalNewlineDecoderu TextIOWrapperuStringIO(((u*/opt/alt/python33/lib64/python3.3/_pyio.pyus\      "      < VnxYDFAUV