ž ©ÿfÉc@südZddlZddlZddlZddlZyddlmZWn"ek rnddl mZYnXddl Z ddl m Z m Z m Z mZdddhZeedƒrÞejejƒejejƒndd ZeZd d eeeeed d „ZGd d„dƒZGdd„dƒZy e jZWn+ek rpGdd„deeƒZYnXGdd„ddejƒZ e j j!e ƒGdd„de ƒZ"e j"j!e"ƒddl#m$Z$e"j!e$ƒGdd„de ƒZ%e j%j!e%ƒGdd„de%ƒZ&Gdd„de%ƒ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|tttfƒs+td|ƒ‚nt|tƒsMtd|ƒ‚nt|tƒsotd|ƒ‚n|dk ržt|tƒ ržtd|ƒ‚n|dk rÍt|tƒ rÍtd|ƒ‚nt|ƒ}|tdƒst|ƒt|ƒkrtd|ƒ‚nd|k} d|k} d |k} d |k} d |k} d |k}d |k}d|krž| s†| s†| r•tdƒ‚nd} n|r¹|r¹tdƒ‚n| | | | dkràtdƒ‚n| põ| põ| põ| stdƒ‚n|r(|dk r(tdƒ‚n|rI|dk rItdƒ‚n|rj|dk rjtdƒ‚nt || r|dpd| r‹dpŽd| r›d pžd| r«d p®d| r»d p¾d|d|ƒ}d}|dksø|dkr|j ƒrd }d}n|dkrkt }ytj|jƒƒj}Wntjtfk rRYqkX|dkrk|}qkn|dkr†tdƒ‚n|dkr«|rœ|Stdƒ‚n| rÃt||ƒ}nL| sÕ| sÕ| rçt||ƒ}n(| rÿt||ƒ}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"sŒv (          ?$       uopencBs&|EeZdZdZdd„ZdS(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 DocDescriptoråsu DocDescriptorcBs/|EeZdZdZeƒZdd„ZdS(u OpenWrapperu¶Wrapper 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 OpenWrapperîs u OpenWrappercBs|EeZdZdS(uUnsupportedOperationN(u__name__u __module__u __qualname__(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuUnsupportedOperationsuUnsupportedOperationcBs^|EeZdZdZdd„Zddd„Zdd„Zd4d d „Zd d „Z d5Z d d„Z dd„Z dd„Zd4dd„Zdd„Zd4dd„Zdd„Zd4dd„Zedd„ƒZd4dd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd6d*d+„Zd,d-„Zd.d/„Zd4d0d1„Zd2d3„Zd4S(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|fƒ‚dS(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|jdƒdS(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|jddƒS(u5Return an int indicating the current stream position.ii(useek(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutell?su IOBase.tellcCs|jdƒdS(uŒTruncate 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|jƒdS(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|jƒWdd|_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|jƒWnYnXdS(uDestructor. Calls close().N(uclose(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__del__bsuIOBase.__del__cCsdS(uÌReturn 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|jƒs-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(uƒReturn 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|jƒs-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_checkReadable†s uIOBase._checkReadablecCsdS(u“Return 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.pyuwritable�suIOBase.writablecCs1|jƒs-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_checkWritable”s uIOBase._checkWritablecCs|jS(u…closed: 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.pyuclosed›su 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 _checkClosed£s 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|jƒdS(u+Context management protocol. Calls close()N(uclose(uselfuargs((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__exit__±suIOBase.__exit__cCs|jdƒdS(u’Returns 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.pyufileno¹su IOBase.filenocCs|jƒdS(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.pyuisattyÀs u IOBase.isattyics×tˆdƒr'‡‡fdd†}n dd„}ˆd krHd ‰ntˆtƒsftdƒ‚ntƒ}x[ˆdks�t|ƒˆkr̈j|ƒƒ}|s¬Pn||7}|jdƒrrPqrqrWt |ƒ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. upeekcsZˆjdƒ}|sdS|jdƒdp5t|ƒ}ˆdkrVt|ˆƒ}n|S(Nis i(upeekufindulenumin(u readaheadun(ulimituself(u*/opt/alt/python33/lib64/python3.3/_pyio.pyu nreadaheadÖs u#IOBase.readline..nreadaheadcSsdS(Ni((((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu nreadaheadßsiulimit must be an integeris Niÿÿÿÿ( uhasattruNoneu isinstanceuintu TypeErroru bytearrayulenureaduendswithubytes(uselfulimitu nreadaheaduresub((ulimituselfu*/opt/alt/python33/lib64/python3.3/_pyio.pyureadlineÊs     ! uIOBase.readlinecCs|jƒ|S(N(u _checkClosed(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__iter__ïs uIOBase.__iter__cCs|jƒ}|st‚n|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(uéReturn 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 readlinesùs    uIOBase.readlinescCs,|jƒx|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 dd„Zdd„Zdd„Zd d „Zd S( u RawIOBaseuBase class for raw binary I/O.icCss|dkrd}n|dkr+|jƒSt|jƒƒ}|j|ƒ}|dkr\dS||d…=t|ƒS(u´Read 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|jdƒdS(uÈRead 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|jdƒdS(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 dd„Zd dd„Zdd„Zdd „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|jdƒdS(užRead 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|jdƒdS(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|…|jdkrtdƒ‚n|jƒ|j}d|_|S(Nuraw stream already detached(urawuNoneu ValueErroruflushu_raw(uselfuraw((u*/opt/alt/python33/lib64/python3.3/_pyio.pyudetachâs    u_BufferedIOMixin.detachcCs |jjƒS(N(urawuseekable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuseekableìsu_BufferedIOMixin.seekablecCs |jjƒS(N(urawureadable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadableïsu_BufferedIOMixin.readablecCs |jjƒS(N(urawuwritable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwritableòsu_BufferedIOMixin.writablecCs|jS(N(u_raw(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyurawõsu_BufferedIOMixin.rawcCs |jjS(N(urawuclosed(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuclosedùsu_BufferedIOMixin.closedcCs |jjS(N(urawuname(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyunameýsu_BufferedIOMixin.namecCs |jjS(N(urawumode(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyumodesu_BufferedIOMixin.modecCstdj|jjƒƒ‚dS(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 |jjƒS(N(urawufileno(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyufilenosu_BufferedIOMixin.filenocCs |jjƒS(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_BufferedIOMixin­s&         u_BufferedIOMixincBsÂ|EeZdZdZddd„Zdd„Zdd„Zdd „Zdd d „Z d d „Z dd„Z ddd„Z dd„Z ddd„Zdd„Zdd„Zdd„ZdS(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%|jrtdƒ‚n|jjƒS(Nu__getstate__ on closed file(uclosedu ValueErroru__dict__ucopy(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu __getstate__&s uBytesIO.__getstate__cCs%|jrtdƒ‚nt|jƒS(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|jƒS(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¯|jrtdƒ‚n|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Ã|jrtdƒ‚nt|tƒr6tdƒ‚nt|ƒ}|dkrRdS|j}|t|jƒkr™d|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ý|jrtdƒ‚ny |jWn4tk rY}ztdƒ|‚WYdd}~XnX|dkr”|dkrˆtd|fƒ‚n||_nb|dkr¼td|j|ƒ|_n:|dkrêtdt|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|jrtdƒ‚n|jS(Nutell on closed file(uclosedu ValueErroru_pos(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutellos u BytesIO.tellcCs¨|jrtdƒ‚n|dkr0|j}ndy |jWn4tk rq}ztdƒ|‚WYdd}~XnX|dkr”td|fƒ‚n|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|jrtdƒ‚ndS(NuI/O operation on closed file.T(uclosedu ValueErroruTrue(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadableƒs uBytesIO.readablecCs|jrtdƒ‚ndS(NuI/O operation on closed file.T(uclosedu ValueErroruTrue(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwritableˆs uBytesIO.writablecCs|jrtdƒ‚ndS(NuI/O operation on closed file.T(uclosedu ValueErroruTrue(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuseekable�s 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˜|EeZdZdZedd„Zdd„Zddd„Zddd „Z d d d „Z d d d„Z dd„Z dd„Z d dd„ZdS(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|jƒstdƒ‚ntj||ƒ|dkrFtdƒ‚n||_|jƒtƒ|_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_buf«s uBufferedReader._reset_read_bufc CsH|dk r'|dkr'tdƒ‚n|j�|j|ƒSWdQXdS(uöRead 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.pyuread¯s uBufferedReader.readc CsNd}d}|j}|j}|dks6|dkr&|jƒt|jdƒr–|jjƒ}|dkr�||d…p€dS||d…|Sn||d…g}d}xay|jjƒ}Wntk rÜw²YnX||kró|}Pn|t |ƒ7}|j |ƒq²dj |ƒp%|St |ƒ|} || krc|j|7_||||…S||d…g}t |j |ƒ} xq| |krûy|jj| ƒ}Wntk rÄw‹YnX||krÛ|}Pn| t |ƒ7} |j |ƒq‹Wt|| ƒ}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_unlocked¼sZ          uBufferedReader._read_unlockedic Cs!|j�|j|ƒSWdQXdS(uéReturns 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.pyupeekös uBufferedReader.peekc CsÈt||jƒ}t|jƒ|j}||ks@|dkr´|j|}x2y|jj|ƒ}Wntk r}wPYnXPqP|r´|j|jd…||_d|_q´n|j|jd…S(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|dkrtdƒ‚n|dkr+dS|j�8|jdƒ|jt|t|jƒ|jƒƒSWdQXdS(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{|tkrtdƒ‚n|j�Q|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.pyuBufferedReader“s   :  uBufferedReadercBsw|EeZdZdZedd„Zdd„Zddd„Zdd „Z d d „Z d d „Z ddd„Z dS(uBufferedWriteruÕA 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|jƒstdƒ‚ntj||ƒ|dkrFtdƒ‚n||_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|jrtdƒ‚nt|tƒr6tdƒ‚n|j�t|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�|jƒWdQXdS(N(u _write_locku_flush_unlocked(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuflushas uBufferedWriter.flushc CsÞ|jrtdƒ‚nx¿|jrÙy|jj|jƒ}Wn2tk rTwYntk rqtdƒ‚YnX|dkr–tt j ddƒ‚n|t |jƒks·|dkrÆt dƒ‚n|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|jƒS(N(u_BufferedIOMixinutellulenu _write_buf(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutellxsuBufferedWriter.tellic CsL|tkrtdƒ‚n|j�"|jƒtj|||ƒ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¹|EeZdZdZedd„Zddd„Zdd„Zdd „Z d d d „Z d d„Z dd„Z dd„Z dd„Zdd„Zdd„Zedd„ƒZdS(uBufferedRWPairu“A 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^|jƒstdƒ‚n|jƒs6tdƒ‚nt||ƒ|_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.pyuread¡s  uBufferedRWPair.readcCs|jj|ƒS(N(ureaderureadinto(uselfub((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadinto¦suBufferedRWPair.readintocCs|jj|ƒS(N(uwriteruwrite(uselfub((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwrite©suBufferedRWPair.writeicCs|jj|ƒS(N(ureaderupeek(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyupeek¬suBufferedRWPair.peekcCs|jj|ƒS(N(ureaderuread1(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuread1¯suBufferedRWPair.read1cCs |jjƒS(N(ureaderureadable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadable²suBufferedRWPair.readablecCs |jjƒS(N(uwriteruwritable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuwritableµsuBufferedRWPair.writablecCs |jjƒS(N(uwriteruflush(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuflush¸suBufferedRWPair.flushcCs|jjƒ|jjƒdS(N(uwriterucloseureader(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuclose»s uBufferedRWPair.closecCs|jjƒp|jjƒS(N(ureaderuisattyuwriter(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuisatty¿suBufferedRWPair.isattycCs |jjS(N(uwriteruclosed(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuclosedÂsuBufferedRWPair.closedN(u__name__u __module__u __qualname__u__doc__uDEFAULT_BUFFER_SIZEu__init__uNoneureadureadintouwriteupeekuread1ureadableuwritableuflushucloseuisattyupropertyuclosed(u __locals__((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuBufferedRWPairƒs         uBufferedRWPaircBs•|EeZdZdZedd„Zddd„Zdd„Zdd d „Z dd d „Z d d„Z ddd„Z dd„Z dd„ZdS(uBufferedRandomuçA 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|jƒtj|||ƒtj|||ƒdS(N(u_checkSeekableuBufferedReaderu__init__uBufferedWriter(uselfurawu buffer_size((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__init__Ðs uBufferedRandom.__init__icCs²|tkrtdƒ‚n|jƒ|jrd|j�(|jj|jt|jƒdƒWdQXn|jj||ƒ}|j�|j ƒWdQX|dkr®t dƒ‚n|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.pyuseekÕs    ,  uBufferedRandom.seekcCs'|jrtj|ƒStj|ƒSdS(N(u _write_bufuBufferedWriterutelluBufferedReader(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutellæs  uBufferedRandom.tellcCs+|dkr|jƒ}ntj||ƒS(N(uNoneutelluBufferedWriterutruncate(uselfupos((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutruncateìs uBufferedRandom.truncatecCs/|dkrd}n|jƒtj||ƒS(Niiÿÿÿÿ(uNoneuflushuBufferedReaderuread(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadòs   uBufferedRandom.readcCs|jƒtj||ƒS(N(uflushuBufferedReaderureadinto(uselfub((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadintoøs uBufferedRandom.readintocCs|jƒtj||ƒS(N(uflushuBufferedReaderupeek(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyupeeküs uBufferedRandom.peekcCs|jƒtj||ƒS(N(uflushuBufferedReaderuread1(uselfun((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuread1s uBufferedRandom.read1c CsY|jrI|j�2|jj|jt|jƒdƒ|jƒWdQXntj||ƒ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.pyuBufferedRandomÇs   uBufferedRandomcBs’|EeZdZdZddd„Zdd„Zddd„Zd d „Zd d „Z e d d„ƒZ e dd„ƒZ e dd„ƒZ dS(u TextIOBaseuàBase 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|jdƒdS(uáRead 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|jdƒdS(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|jdƒdS(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|jdƒdS(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|jdƒdS(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(u’Line 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€|EeZdZdZddd„Zddd„Zdd„Zd d „Zd d „Z d Z dZ dZ e dd„ƒZdS(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|jdƒr�| 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 FiÿÿÿÿT(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?fƒndS(Ni(uboolu pendingcrudecoderuNoneusetstate(uselfustateubufuflag((u*/opt/alt/python33/lib64/python3.3/_pyio.pyusetstate‰s u"IncrementalNewlineDecoder.setstatecCs5d|_d|_|jdk r1|jjƒndS(NiF(useennluFalseu pendingcrudecoderuNoneureset(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureset�s  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.pyunewlines™su"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ô|EeZdZdZdZdDdDdDdEdEdd„Zdd„Ze dd„ƒZ e d d „ƒZ e d d „ƒZ e d d„ƒZ dd„Zdd„Zdd„Zdd„Zdd„Ze dd„ƒZe dd„ƒZdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„ZdDd)d*„Zd+d,„Zd-d.„Zd/d/d/d/d0d1„Zd2d3„Zd4d5„Z dDd6d7„Z!d8d9„Z"d/d:d;„Z#dDd<d=„Z$d>d?„Z%dDd@dA„Z&e dBdC„ƒZ'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|ƒfƒ‚n|dkrZtd|fƒ‚n|dkræytj|jƒƒ}Wnt t fk r™YnX|dkræyddl }Wnt k rÐd}YqãX|j dƒ}qænt|tƒstd |ƒ‚ntj|ƒjs3d }t||ƒ‚n|dkrHd }n"t|tƒsjtd |ƒ‚n||_||_||_||_| |_|dk|_||_|dk|_|pËtj|_d|_d|_d|_d|_ d|_!|j"j#ƒ|_$|_%t&|j"d ƒ|_'d|_(|j$r—|j)ƒr—|j"j*ƒ} | dkr—y|j+ƒj,dƒWq”tk r�Yq”Xq—ndS(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__cCs„d}y |j}Wntk r'YnX|dj|ƒ7}y |j}Wntk r\YnX|dj|ƒ7}|dj|jƒS(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|jrtdƒ‚n|jS(NuI/O operation on closed file.(uclosedu ValueErroru _seekable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuseekable)s uTextIOWrapper.seekablecCs |jjƒS(N(ubufferureadable(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyureadable.suTextIOWrapper.readablecCs |jjƒS(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|jƒWd|jjƒXndS(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 |jjƒS(N(ubufferufileno(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyufilenoGsuTextIOWrapper.filenocCs |jjƒS(N(ubufferuisatty(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyuisattyJsuTextIOWrapper.isattyc Cs"|jrtdƒ‚nt|tƒs@td|jjƒ‚nt|ƒ}|js^|j ogd|k}|r |jr |j dkr |j d|j ƒ}n|j p²|j ƒ}|j|ƒ}|jj|ƒ|j rü|sïd|krü|jƒnd|_|jr|jjƒn|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|krtdƒ‚n|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_chars‚su#TextIOWrapper._rewind_decoded_charscCsð|jdkrtdƒ‚n|jr?|jjƒ\}}n|jr`|jj|jƒ}n|jj |jƒ}| }|jj ||ƒ}|j |ƒ|rÃt |ƒ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_chunkˆs      uTextIOWrapper._read_chunkicCs*||d>B|d>B|d>Bt|ƒd>BS(Ni@i€iÀi(ubool(uselfupositionu dec_flagsu bytes_to_feeduneed_eofu chars_to_skip((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu _pack_cookie²suTextIOWrapper._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_cookie¼s uTextIOWrapper._unpack_cookiecCs.|jstdƒ‚n|js0tdƒ‚n|jƒ|jjƒ}|j}|dksm|j dkr‰|j r…t dƒ‚n|S|j \}}|t |ƒ8}|j }|dkrÍ|j||ƒS|jƒ}z@t|j|ƒ}d}|t |ƒks t ‚xÀ|dkr¶|jd|fƒt |j|d|…ƒƒ} | |krŸ|jƒ\} } | s†| }|| 8}Pn|t | ƒ8}d}q||8}|d}qWd}|jd|fƒ||} |} |dkrü|j| | ƒSd}d}d}xît|t |ƒƒD]—}|d7}|t |j|||d…ƒƒ7}|jƒ\}}| r«||kr«| |7} ||8}|dd} }}n||kr$Pq$q$W|t |jddd ƒƒ7}d}||krÿtd ƒ‚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.pyutellÃsx               '    uTextIOWrapper.tellcCs5|jƒ|dkr%|jƒ}n|jj|ƒS(N(uflushuNoneutellubufferutruncate(uselfupos((u*/opt/alt/python33/lib64/python3.3/_pyio.pyutruncate&s  uTextIOWrapper.truncatecCs>|jdkrtdƒ‚n|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¼|jrtdƒ‚n|js0tdƒ‚n|dkrl|dkrWtdƒ‚nd}|jƒ}n|dkrå|dkr“tdƒ‚n|jƒ|jjddƒ}|jdƒd|_ |j rá|j j ƒn|S|dkrtd |fƒ‚n|dkr)td |fƒ‚n|jƒ|j |ƒ\}}}}}|jj|ƒ|jdƒd|_ |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 r‘Yn'X|dkr®| jdƒn | 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 dƒd|_ |Sd}|j|ƒ}xGt|ƒ|kr"| r"|jƒ }||j|t|ƒƒ7}qÜW|SdS( Niuan integer is requirediufinaluiÿÿÿÿTF(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|_t‚n|S(NF(uFalseu_tellingureadlineuNoneu _snapshotu _seekableu StopIteration(uselfuline((u*/opt/alt/python33/lib64/python3.3/_pyio.pyu__next__”s     uTextIOWrapper.__next__cCs‚|jrtdƒ‚n|dkr-d }nt|tƒsKtdƒ‚n|jƒ}d}|jss|jƒnd}}x¼|j rÄ|j d|ƒ}|dkrµ|d}Pq»t |ƒ}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|dkrãt |ƒ|krã|}Pnx|jƒr|jræPqæqæW|jr||jƒ7}q€|jdƒd|_|Sq€|dkr]||kr]|}n|jt |ƒ|ƒ|d|…S( Nuread from closed fileiulimit must be an integeriu u iuiÿÿÿÿiÿÿÿÿiÿÿÿÿiÿÿÿÿ(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.pyureadline�sp                          uTextIOWrapper.readlinecCs|jr|jjSdS(N(u_decoderunewlinesuNone(uself((u*/opt/alt/python33/lib64/python3.3/_pyio.pyunewlinesõsuTextIOWrapper.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 TextIOWrapper¦sH E             *  c G Xu TextIOWrappercsz|EeZdZdZdd‡fdd†Zdd„Zdd „Zed d „ƒZed d „ƒZ dd„Z ‡S(uStringIOu»Text 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 cs¬tt|ƒjtƒddddd|ƒ|dkrCd|_n|dk r¨t|tƒs‹t dj t |ƒj ƒƒ‚t|ƒ}n|j |ƒ|jdƒndS( 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ƒ}|jƒz |j|jjƒddƒSWd|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|jdƒdS(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.pyuStringIOús 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\      "     ÿ < Vnx—YDFAUÿÿV