ACC SHELL

Path : /usr/lib/python/
File Upload :
Current File : //usr/lib/python/io.pyc

oMc@sdZddklZddklZdZddddd	d
ddd
dddddgZddkZddkZddkZddk	Z	ddk
Z
ddZeZ
defdYZdeeeeedZdfdYZdfdYZdeefdYZd efd!YZd"efd#YZd$e	iefd%YZd&efd'YZd(efd)YZd*efd+YZy,ddkZd,eiefd-YZ Wne!j
o
eZ nXd.efd/YZ"d0efd1YZ#d2efd3YZ$d4e#e"fd5YZ%d6efd7YZ&d8ei'fd9YZ(d:e&fd;YZ)d<e)fd=YZ*dS(>u
The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.

At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
separation between reading and writing to streams; implementations are
allowed to throw an IOError if they do not support a given operation.

Extending IOBase is RawIOBase which deals simply with the reading and
writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide
an interface to OS files.

BufferedIOBase deals with buffering on a raw byte stream (RawIOBase). Its
subclasses, BufferedWriter, BufferedReader, and BufferedRWPair buffer
streams that are readable, writable, and both respectively.
BufferedRandom provides a buffered interface to random access
streams. BytesIO is a simple stream of in-memory bytes.

Another IOBase subclass, TextIOBase, deals with the encoding and decoding
of streams into text. TextIOWrapper, which extends it, is a buffered text
interface to a buffered raw stream (`BufferedIOBase`). Finally, StringIO
is a in-memory stream for text.

Argument names are not part of the specification, and only the arguments
of open() are intended to be used as keyword arguments.

data:

DEFAULT_BUFFER_SIZE

   An int containing the default buffer size used by the module's buffered
   I/O classes. open() uses the file's blksize (as obtained by os.stat) if
   possible.
i(tprint_function(tunicode_literalsuqGuido van Rossum <guido@python.org>, Mike Verdone <mike.verdone@gmail.com>, Mark Russell <mark.russell@zen.co.uk>uBlockingIOErroruopenuIOBaseu	RawIOBaseuFileIOuBytesIOuStringIOuBufferedIOBaseuBufferedReaderuBufferedWriteruBufferedRWPairuBufferedRandomu
TextIOBaseu
TextIOWrapperNiitBlockingIOErrorcBseZdZddZRS(uCException raised when I/O would block on a non-blocking I/O stream.icCs ti|||||_dS(N(tIOErrort__init__tcharacters_written(tselfterrnotstrerrorR((s/usr/lib/python2.6/io.pyRLs(t__name__t
__module__t__doc__R(((s/usr/lib/python2.6/io.pyRHsurc	Csnt|ttfptd|nt|tptd|n|dj	o%t|totd|n|dj	o%t|totd|n|dj	o%t|totd|nt|}|tdpt|t|jotd|nd|j}d|j}	d	|j}
d
|j}d|j}d|j}
d
|jo(|	p|
otdnt}n|o|
otdn||	|
djotdn|p|	p|
ptdn|
o|dj	otdn|
o|dj	otdn|
o|dj	otdnt	||odpd|	odpd|
od	pd|od
pd|}|djo
d}nt
}|djp|djo|iod}t}n|djo\t}yt
i|ii}Wnt
itfj
oqX|djo
|}qn|djotdn|djo|
o|Stdn|ot||}nL|	p|
ot||}n+|ot||}ntd||
o|St|||||}||_|S(uOpen file and return a stream. If the file cannot be opened, an IOError is
    raised.

    file is either a 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), 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
    '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.

    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 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 controls 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.

    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.

    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: %ruarwb+tUuruwuau+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 argumentuiiuinvalid buffering sizeucan't have unbuffered text I/Ouunknown mode: %rN(t
isinstancet
basestringtintt	TypeErrortNonetsettlent
ValueErrortTruetFileIOtFalsetisattytDEFAULT_BUFFER_SIZEtostfstattfilenot
st_blksizeterrortAttributeErrortBufferedRandomtBufferedWritertBufferedReadert
TextIOWrappertmode(tfileR#t	bufferingtencodingterrorstnewlinetclosefdtmodestreadingtwritingt	appendingtupdatingttexttbinarytrawtline_bufferingtbstbuffer((s/usr/lib/python2.6/io.pytopenQsn*

5	

'




	t_DocDescriptorcBseZdZdZRS(u%Helper for builtins.open.__doc__
    cCsdtiS(Nu^open(file, mode='r', buffering=None, encoding=None, errors=None, newline=None, closefd=True)

(R5R(Rtobjttyp((s/usr/lib/python2.6/io.pyt__get__s(R	R
RR9(((s/usr/lib/python2.6/io.pyR6stOpenWrappercBs eZdZeZdZRS(uWrapper for builtins.open

    Trick so that open won't become a bound method when stored
    as a class variable (as dumbdbm does).

    See initstdio() in Python/pythonrun.c.
    cOs
t||S(N(R5(tclstargstkwargs((s/usr/lib/python2.6/io.pyt__new__s(R	R
RR6R>(((s/usr/lib/python2.6/io.pyR:s	tUnsupportedOperationcBseZRS((R	R
(((s/usr/lib/python2.6/io.pyR?"stIOBasecBseZdZeiZdZddZdZddZ
dZeZ
dZdZd	Zdd
ZdZddZd
ZddZedZddZdZdZdZdZddZdZdZddZ dZ!RS(uThe 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 a IOError 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 statment is complete:

    with open('spam.txt', 'r') as fp:
        fp.write('Spam and eggs!')
    cCs td|ii|fdS(u8Internal: raise an exception for unsupported operations.u%s.%s() not supportedN(R?t	__class__R	(Rtname((s/usr/lib/python2.6/io.pyt_unsupportedJsicCs|iddS(uChange stream position.

        Change the stream position to byte offset offset. offset is
        interpreted relative to the position indicated by whence.  Values
        for whence are:

        * 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

        Return the new absolute position.
        useekN(RC(Rtpostwhence((s/usr/lib/python2.6/io.pytseekQs
cCs|iddS(uReturn current stream position.ii(RF(R((s/usr/lib/python2.6/io.pyttell`scCs|iddS(uTruncate file to size bytes.

        Size defaults to the current IO position as reported by tell().  Return
        the new size.
        utruncateN(RC(RRD((s/usr/lib/python2.6/io.pyttruncatedscCsdS(uuFlush write buffers, if applicable.

        This is not implemented for read-only and non-blocking streams.
        N((R((s/usr/lib/python2.6/io.pytflushnscCs?|ip1y|iWntj
onXt|_ndS(uiFlush and close the IO object.

        This method has no effect if the file is already closed.
        N(t_IOBase__closedRIRR(R((s/usr/lib/python2.6/io.pytclosews
cCsy|iWnnXdS(uDestructor.  Calls close().N(RK(R((s/usr/lib/python2.6/io.pyt__del__scCstS(uReturn whether object supports random access.

        If False, seek(), tell() and truncate() will raise IOError.
        This method may need to do a test seek().
        (R(R((s/usr/lib/python2.6/io.pytseekablescCs5|ip$t|djodn|ndS(u;Internal: raise an IOError if file is not seekable
        uFile or stream is not seekable.N(RMRR(Rtmsg((s/usr/lib/python2.6/io.pyt_checkSeekables
cCstS(udReturn whether object was opened for reading.

        If False, read() will raise IOError.
        (R(R((s/usr/lib/python2.6/io.pytreadablescCs5|ip$t|djodn|ndS(u;Internal: raise an IOError if file is not readable
        uFile or stream is not readable.N(RPRR(RRN((s/usr/lib/python2.6/io.pyt_checkReadables
cCstS(utReturn whether object was opened for writing.

        If False, write() and truncate() will raise IOError.
        (R(R((s/usr/lib/python2.6/io.pytwritablescCs5|ip$t|djodn|ndS(u;Internal: raise an IOError if file is not writable
        uFile or stream is not writable.N(RRRR(RRN((s/usr/lib/python2.6/io.pyt_checkWritables
cCs|iS(uclosed: bool.  True iff the file has been closed.

        For backwards compatibility, this is a property, not a predicate.
        (RJ(R((s/usr/lib/python2.6/io.pytclosedscCs2|io$t|djodn|ndS(u8Internal: raise an ValueError if file is closed
        uI/O operation on closed file.N(RTRR(RRN((s/usr/lib/python2.6/io.pyt_checkCloseds
cCs|i|S(u+Context management protocol.  Returns self.(RU(R((s/usr/lib/python2.6/io.pyt	__enter__s
cGs|idS(u+Context management protocol.  Calls close()N(RK(RR<((s/usr/lib/python2.6/io.pyt__exit__scCs|iddS(uReturns underlying file descriptor if one exists.

        An IOError is raised if the IO object does not use a file descriptor.
        ufilenoN(RC(R((s/usr/lib/python2.6/io.pyRscCs|itS(uiReturn whether this is an 'interactive' stream.

        Return False if it can't be determined.
        (RUR(R((s/usr/lib/python2.6/io.pyRs
icsitdofd}n
d}djo
dntttfptdnt}xbdjpt|joAi	|}|pPn||7}|i
doPqqWt|S(	u(Read and return a line from the stream.

        If limit is specified, at most limit bytes will be read.

        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.
        upeekcs_id}|pdS|iddp
t|}djot|}n|S(Nis
i(tpeektfindRtmin(t	readaheadtn(Rtlimit(s/usr/lib/python2.6/io.pyt
nreadaheads 
cSsdS(Ni((((s/usr/lib/python2.6/io.pyR^siulimit must be an integeris
N(RUthasattrRRRtlongRt	bytearrayRtreadtendswithtbytes(RR]R^trestb((RR]s/usr/lib/python2.6/io.pytreadlines$	
		

	 

cCs|i|S(N(RU(R((s/usr/lib/python2.6/io.pyt__iter__s
cCs!|i}|p
tn|S(N(Rgt
StopIteration(Rtline((s/usr/lib/python2.6/io.pytnexts
cCs|djo
d}nt|ttfptdn|djot|Sd}g}x=|D]5}|i||t|7}||joPqhqhW|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.
        iuhint must be an integeriN(RRRR`RtlisttappendR(RthintR\tlinesRj((s/usr/lib/python2.6/io.pyt	readliness




	cCs,|ix|D]}|i|qWdS(N(RUtwrite(RRoRj((s/usr/lib/python2.6/io.pyt
writelines0s
N("R	R
RtabctABCMetat
__metaclass__RCRFRGRRHRIRRJRKRLRMRORPRQRRRStpropertyRTRURVRWRRRgRhRkRpRr(((s/usr/lib/python2.6/io.pyR@&s6			
											
$		t	RawIOBasecBs5eZdZddZdZdZdZRS(uBase class for raw binary I/O.icCsa|djo
d}n|djo|iSt|i}|i|}||3t|S(uRead and return up to n bytes.

        Returns an empty bytes array on EOF, or None if the object is
        set not to block and has no data to read.
        iiN(RtreadallRat	__index__treadintoRd(RR\Rf((s/usr/lib/python2.6/io.pyRbDs


cCsGt}x1to)|it}|pPn||7}qWt|S(u+Read until EOF, using multiple read() call.(RaRRbRRd(RRetdata((s/usr/lib/python2.6/io.pyRxSs	cCs|iddS(uRead up to len(b) bytes into b.

        Returns number of bytes read (0 for EOF), or None if the object
        is set not to block as has no data to read.
        ureadintoN(RC(RRf((s/usr/lib/python2.6/io.pyRz]scCs|iddS(u~Write the given buffer to the IO stream.

        Returns the number of bytes written, which may be less than len(b).
        uwriteN(RC(RRf((s/usr/lib/python2.6/io.pyRqes(R	R
RRbRxRzRq(((s/usr/lib/python2.6/io.pyRw6s
	
	RcBs5eZdZdedZdZedZRS(u$Raw I/O implementation for OS files.urcCs&tii||||||_dS(N(t_fileiot_FileIORt_name(RRBR#R)((s/usr/lib/python2.6/io.pyRvscCs!tii|ti|dS(N(R|R}RKRw(R((s/usr/lib/python2.6/io.pyRKzscCs|iS(N(R~(R((s/usr/lib/python2.6/io.pyRB~s(R	R
RRRRKRvRB(((s/usr/lib/python2.6/io.pyRms	tBufferedIOBasecBs,eZdZddZdZdZRS(uBase 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|iddS(uRead and return up to n bytes.

        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(RC(RR\((s/usr/lib/python2.6/io.pyRbscCs|it|}t|}y|||*WnTtj
oH}ddk}t||ip
|n|id|||*nX|S(u=Read up to len(b) bytes into b.

        Like read(), this may issue multiple reads to the underlying raw
        stream, unless the latter is 'interactive'.

        Returns the number of bytes read (0 for EOF).

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        iNRf(RbRRtarrayR(RRfR{R\terrR((s/usr/lib/python2.6/io.pyRzs
cCs|iddS(u
Write the given buffer to the IO stream.

        Return the number of bytes written, which is never less than
        len(b).

        Raises BlockingIOError if the buffer is full and the
        underlying raw stream cannot accept more data at the moment.
        uwriteN(RC(RRf((s/usr/lib/python2.6/io.pyRqs	N(R	R
RRRbRzRq(((s/usr/lib/python2.6/io.pyRs	t_BufferedIOMixincBseZdZdZddZdZddZdZdZ	dZ
d	Zd
Ze
dZe
dZe
d
ZdZdZRS(uA mixin implementation of BufferedIOBase with an underlying raw stream.

    This passes most requests on to the underlying raw stream.  It
    does *not* provide implementations of read(), readinto() or
    write().
    cCs
||_dS(N(R1(RR1((s/usr/lib/python2.6/io.pyRsicCs|ii||S(N(R1RF(RRDRE((s/usr/lib/python2.6/io.pyRFscCs
|iiS(N(R1RG(R((s/usr/lib/python2.6/io.pyRGscCs7|i|djo|i}n|ii|S(N(RIRRGR1RH(RRD((s/usr/lib/python2.6/io.pyRHs

cCs|iidS(N(R1RI(R((s/usr/lib/python2.6/io.pyRIscCsC|ip5y|iWntj
onX|iindS(N(RTRIRR1RK(R((s/usr/lib/python2.6/io.pyRKs
cCs
|iiS(N(R1RM(R((s/usr/lib/python2.6/io.pyRMscCs
|iiS(N(R1RP(R((s/usr/lib/python2.6/io.pyRPscCs
|iiS(N(R1RR(R((s/usr/lib/python2.6/io.pyRRscCs
|iiS(N(R1RT(R((s/usr/lib/python2.6/io.pyRTscCs
|iiS(N(R1RB(R((s/usr/lib/python2.6/io.pyRBscCs
|iiS(N(R1R#(R((s/usr/lib/python2.6/io.pyR#scCs
|iiS(N(R1R(R((s/usr/lib/python2.6/io.pyRscCs
|iiS(N(R1R(R((s/usr/lib/python2.6/io.pyRsN(R	R
RRRFRGRRHRIRKRMRPRRRvRTRBR#RR(((s/usr/lib/python2.6/io.pyRs				
				t_BytesIOcBs}eZdZd
dZdZd
dZdZdZddZ	dZ
d
d	Zd
ZdZ
dZRS(u<Buffered I/O implementation using an in-memory bytes buffer.cCs@t}|dj	o|t|7}n||_d|_dS(Ni(RaRt_buffert_pos(Rt
initial_bytestbuf((s/usr/lib/python2.6/io.pyRs
	
	cCs'|iotdnt|iS(u8Return the bytes value (contents) of the buffer
        ugetvalue on closed file(RTRRdR(R((s/usr/lib/python2.6/io.pytgetvalue%s
cCs|iotdn|djo
d}nt|ttfptdn|djot|i}nt|i|i	jodSt
t|i|i	|}|i|i	|!}||_	t|S(Nuread from closed fileiuargument must be an integerit(RTRRRRR`RRRRRZRd(RR\tnewposRf((s/usr/lib/python2.6/io.pyRb,s



	cCs
|i|S(u"this is the same as read.
        (Rb(RR\((s/usr/lib/python2.6/io.pytread1<scCs|iotdnt|totdnt|}|djodS|i}|t|ijo*d|t|i}|i|7_n||i|||+|i|7_|S(Nuwrite to closed fileu$can't write unicode to binary streamit(RTRRtunicodeRRRR(RRfR\RDtpadding((s/usr/lib/python2.6/io.pyRqAs

	icCs|iotdny|i}Wn!tj
o}tdnX|djo1|djotd|fn||_ng|djotd|i||_n=|djo#tdt|i||_n
td|iS(Nuseek on closed fileuan integer is requirediunegative seek position %riiuinvalid whence value(	RTRRyRRRtmaxRR(RRDRER((s/usr/lib/python2.6/io.pyRFSs 





#cCs!|iotdn|iS(Nutell on closed file(RTRR(R((s/usr/lib/python2.6/io.pyRGfs
cCsf|iotdn|djo
|i}n%|djotd|fn|i|3|S(Nutruncate on closed fileiunegative truncate position %r(RTRRRR(RRD((s/usr/lib/python2.6/io.pyRHks




cCstS(N(R(R((s/usr/lib/python2.6/io.pyRPuscCstS(N(R(R((s/usr/lib/python2.6/io.pyRRxscCstS(N(R(R((s/usr/lib/python2.6/io.pyRM{sN(R	R
RRRRRbRRqRFRGRHRPRRRM(((s/usr/lib/python2.6/io.pyRs				
		tBytesIOcBseZeiiZRS((R	R
t_bytesioRR(((s/usr/lib/python2.6/io.pyRsR!cBsqeZdZedZdZddZddZddZ	ddZ
dZd	Zdd
Z
RS(uBufferedReader(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.
    cCs@|iti||||_|iti|_dS(uMCreate a new buffered reader using the given readable raw IO object.
        N(RQRRtbuffer_sizet_reset_read_buft	threadingtLockt
_read_lock(RR1R((s/usr/lib/python2.6/io.pyRs

	
cCsd|_d|_dS(NRi(t	_read_buft	_read_pos(R((s/usr/lib/python2.6/io.pyRs	cCs,|iiiz|i|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.
        N(RRWRVt_read_unlocked(RR\((s/usr/lib/python2.6/io.pyRbscCsd}d}|i}|i}|djp
|djo|i||g}d}xPtoH|ii}||jo|}Pn|t|7}|i|qXWdi	|p|St||}	||	jo|i|7_||||!S||g}t
|i|}
xY|	|joK|ii|
}||jo|}Pn|	t|7}	|i|qWt||	}di	|}|||_d|_|o	|| S|S(NRii(RN(
RRRRRR1RbRRmtjoinRRRZ(RR\t
nodata_valtempty_valuesRRDtchunkstcurrent_sizetchunktavailtwantedtout((s/usr/lib/python2.6/io.pyRsH		







	icCs,|iiiz|i|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(RRWRVt_peek_unlocked(RR\((s/usr/lib/python2.6/io.pyRXscCst||i}t|i|i}||joN|i|}|ii|}|o$|i|i||_d|_qn|i|iS(Ni(RZRRRRR1Rb(RR\twantthavetto_readtcurrent((s/usr/lib/python2.6/io.pyRs

c	Csd|djodS|iiiz7|id|it|t|i|iSWdQXdS(u9Reads up to n bytes, with at most one read() system call.iRiN(	RRWRVRRRZRRR(RR\((s/usr/lib/python2.6/io.pyRs

cCs!|iit|i|iS(N(R1RGRRR(R((s/usr/lib/python2.6/io.pyRGscCsm|iiizR|djo|t|i|i8}n|ii||}|i|SWdQXdS(Ni(	RRWRVRRRR1RFR(RRDRE((s/usr/lib/python2.6/io.pyRFs

N(R	R
RRRRRRbRRXRRRGRF(((s/usr/lib/python2.6/io.pyR!s			.
		R cBsYeZdZed	dZdZd	dZdZdZ	dZ
ddZRS(
uA 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
    DEAFULT_BUFFER_SIZE. If max_buffer_size is omitted, it defaults to
    twice the buffer size.
    cCsc|iti||||_|djod|n||_t|_ti	|_
dS(Ni(RSRRRRtmax_buffer_sizeRat
_write_bufRRt_write_lock(RR1RR((s/usr/lib/python2.6/io.pyRs
		cCs|iotdnt|totdn|iiiz6t|i	|i
joBy|iWqtj
o!}t|i
|idqXnt|i	}|i	i|t|i	|}t|i	|i
joy|iWq}tj
og}t|i	|ijoEt|i	|i}|i	|i |_	t|i
|i|qyq}Xn|SWdQXdS(Nuwrite to closed fileu$can't write unicode to binary streami(RTRRRRRRWRVRRRt_flush_unlockedRRRtextendR(RRftetbeforetwrittentoverage((s/usr/lib/python2.6/io.pyRqs,
!%cCsY|iiiz>|i|djo|ii}n|ii|SWdQXdS(N(RRWRVRRR1RGRH(RRD((s/usr/lib/python2.6/io.pyRH:s


cCs)|iiiz|iWdQXdS(N(RRWRVR(R((s/usr/lib/python2.6/io.pyRIAscCs|iotdnd}y?x8|io-|ii|i}|i|4||7}q&WWnJtj
o>}|i}|i|4||7}t|i|i|nXdS(Nuflush of closed filei(	RTRRR1RqRRRR(RRR\R((s/usr/lib/python2.6/io.pyREs


	

cCs|iit|iS(N(R1RGRR(R((s/usr/lib/python2.6/io.pyRGTsicCs<|iiiz!|i|ii||SWdQXdS(N(RRWRVRR1RF(RRDRE((s/usr/lib/python2.6/io.pyRFWs
N(R	R
RRRRRqRHRIRRGRF(((s/usr/lib/python2.6/io.pyR s
				tBufferedRWPaircBseZdZeddZddZdZdZddZ	dZ
dZd	Zd
Z
dZdZed
ZRS(uA 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. The max_buffer_size (for the buffered writer)
    defaults to twice the buffer size.
    cCs?|i|it|||_t||||_dS(uEConstructor.

        The arguments are two RawIO instances.
        N(RQRSR!treaderR twriter(RRRRR((s/usr/lib/python2.6/io.pyRns

cCs'|djo
d}n|ii|S(Ni(RRRb(RR\((s/usr/lib/python2.6/io.pyRbys

cCs|ii|S(N(RRz(RRf((s/usr/lib/python2.6/io.pyRz~scCs|ii|S(N(RRq(RRf((s/usr/lib/python2.6/io.pyRqsicCs|ii|S(N(RRX(RR\((s/usr/lib/python2.6/io.pyRXscCs|ii|S(N(RR(RR\((s/usr/lib/python2.6/io.pyRscCs
|iiS(N(RRP(R((s/usr/lib/python2.6/io.pyRPscCs
|iiS(N(RRR(R((s/usr/lib/python2.6/io.pyRRscCs
|iiS(N(RRI(R((s/usr/lib/python2.6/io.pyRIscCs|ii|iidS(N(RRKR(R((s/usr/lib/python2.6/io.pyRKs
cCs|iip
|iiS(N(RRR(R((s/usr/lib/python2.6/io.pyRscCs
|iiS(N(RRT(R((s/usr/lib/python2.6/io.pyRTsN(R	R
RRRRRbRzRqRXRRPRRRIRKRRvRT(((s/usr/lib/python2.6/io.pyR]s
								RcBsqeZdZeddZddZdZddZddZ	dZ
ddZd	Zd
Z
RS(u<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. The max_buffer_size (for the buffered
    writer) defaults to twice the buffer size.
    cCs7|iti|||ti||||dS(N(ROR!RR (RR1RR((s/usr/lib/python2.6/io.pyRs
icCsH|i|ii||}|iiiz|iWdQX|S(N(RIR1RFRRWRVR(RRDRE((s/usr/lib/python2.6/io.pyRFs

cCs6|io|iit|iSti|SdS(N(RR1RGRR!(R((s/usr/lib/python2.6/io.pyRGs
cCs-|djo|i}nti||S(N(RRGR RH(RRD((s/usr/lib/python2.6/io.pyRHs
cCs1|djo
d}n|iti||S(Ni(RRIR!Rb(RR\((s/usr/lib/python2.6/io.pyRbs


cCs|iti||S(N(RIR!Rz(RRf((s/usr/lib/python2.6/io.pyRzs
cCs|iti||S(N(RIR!RX(RR\((s/usr/lib/python2.6/io.pyRXs
cCs|iti||S(N(RIR!R(RR\((s/usr/lib/python2.6/io.pyRs
cCsf|ioL|iiiz1|ii|it|id|iWdQXnt	i
||S(Ni(RRRWRVR1RFRRRR Rq(RRf((s/usr/lib/python2.6/io.pyRqs

#N(R	R
RRRRRFRGRHRbRzRXRRq(((s/usr/lib/python2.6/io.pyRs				t
TextIOBasecBsVeZdZddZdZddZdZedZ	edZ
RS(	uBase 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|iddS(uRead at most n characters from stream.

        Read from underlying buffer until we have n characters or we hit EOF.
        If n is negative or omitted, read until EOF.
        ureadN(RC(RR\((s/usr/lib/python2.6/io.pyRbscCs|iddS(uWrite string s to stream.uwriteN(RC(Rts((s/usr/lib/python2.6/io.pyRqscCs|iddS(uTruncate size to pos.utruncateN(RC(RRD((s/usr/lib/python2.6/io.pyRHscCs|iddS(u_Read until newline or EOF.

        Returns an empty string if EOF is hit immediately.
        ureadlineN(RC(R((s/usr/lib/python2.6/io.pyRgscCsdS(uSubclasses should override.N(R(R((s/usr/lib/python2.6/io.pyR&scCsdS(uLine endings translated so far.

        Only line endings translated during reading are considered.

        Subclasses should override.
        N(R(R((s/usr/lib/python2.6/io.pytnewlinessN(R	R
RRbRqRRHRgRvR&R(((s/usr/lib/python2.6/io.pyRs		tIncrementalNewlineDecodercBsbeZdZddZedZdZdZdZdZ	dZ
d	Zed
Z
RS(u(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>tii|d|||_||_d|_t|_dS(NR'i(tcodecstIncrementalDecoderRt	translatetdecodertseennlRt	pendingcr(RRRR'((s/usr/lib/python2.6/io.pyRs
			cCs,|ii|d|}|io%|p|od|}t|_n|ido|o|d }t|_n|id}|id|}|id|}|i|o|i|o|i	B|o|i
BO_|io>|o|idd}n|o|idd}q(n|S(Ntfinalu
iu
u
(
RtdecodeRRRcRtcountRt_LFt_CRt_CRLFRtreplace(RtinputRtoutputtcrlftcrtlf((s/usr/lib/python2.6/io.pyRs$



.
cCsA|ii\}}|dK}|io|dO}n||fS(Ni(RtgetstateR(RRtflag((s/usr/lib/python2.6/io.pyR9s


cCs=|\}}t|d@|_|ii||d?fdS(Ni(tboolRRtsetstate(RtstateRR((s/usr/lib/python2.6/io.pyR@scCs#d|_t|_|iidS(Ni(RRRRtreset(R((s/usr/lib/python2.6/io.pyREs		iiic
Cs#ddddddddf|iS(Nu
u
u
(u
u
(u
u
(u
u
(u
u
u
(RR(R((s/usr/lib/python2.6/io.pyRNs(R	R
RRRRRRRRRRRvR(((s/usr/lib/python2.6/io.pyRs			R"cBsdeZdZdZd d d edZedZedZ	edZ
dZdZdZ
d	Zd
ZedZedZd
ZdZdZdZdZdZd dZdZdZdddddZdZdZd dZddZd dZ dZ!d dZ"edZ#RS(!uCharacter 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.

    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|djotd|fn|djoyti|i}Wnttfj
onX|djo<yddk}Wntj
o
d}qX|i	}qnt
|tptd|n|djo
d	}n%t
|tptd
|n||_||_
||_||_||_|dj|_||_|dj|_|pti|_d|_d|_d|_d|_d|_|ii|_|_dS(
Nuu
u
u
uillegal newline value: %riuasciiuinvalid encoding: %rustrictuinvalid errors: %ri(Nuu
u
u
(RRRtdevice_encodingRRR?tlocaletImportErrortgetpreferredencodingRR
R4t_line_bufferingt	_encodingt_errorst_readuniversalt_readtranslatet_readnlt_writetranslatetlinesept_writenlt_encodert_decodert_decoded_charst_decoded_chars_usedt	_snapshotRMt	_seekablet_telling(RR4R&R'R(R2R((s/usr/lib/python2.6/io.pyRusD




				
						cCs|iS(N(R(R((s/usr/lib/python2.6/io.pyR&scCs|iS(N(R(R((s/usr/lib/python2.6/io.pyR'scCs|iS(N(R(R((s/usr/lib/python2.6/io.pyR2scCs|iS(N(R(R((s/usr/lib/python2.6/io.pyRMscCs
|iiS(N(R4RP(R((s/usr/lib/python2.6/io.pyRPscCs
|iiS(N(R4RR(R((s/usr/lib/python2.6/io.pyRRscCs|ii|i|_dS(N(R4RIRR(R((s/usr/lib/python2.6/io.pyRIs
cCs)y|iWnnX|iidS(N(RIR4RK(R((s/usr/lib/python2.6/io.pyRKs
cCs
|iiS(N(R4RT(R((s/usr/lib/python2.6/io.pyRTscCs
|iiS(N(R4RB(R((s/usr/lib/python2.6/io.pyRBscCs
|iiS(N(R4R(R((s/usr/lib/python2.6/io.pyRscCs
|iiS(N(R4R(R((s/usr/lib/python2.6/io.pyRscCs3|iotdnt|tptd|iint|}|ip
|i	o
d|j}|o3|io)|i
djo|id|i
}n|ip
|i
}|i|}|ii||i	o"|p
d|jo|ind|_|io|iin|S(Nuwrite to closed fileucan't write %s to text streamu
u
(RTRRRRRAR	RRRRRRt_get_encodertencodeR4RqRIRRRR(RRtlengththaslftencoderRf((s/usr/lib/python2.6/io.pyRqs$
 !	
cCs+ti|i}||i|_|iS(N(RtgetincrementalencoderRRR(Rtmake_encoder((s/usr/lib/python2.6/io.pyRscCsNti|i}||i}|iot||i}n||_|S(N(RtgetincrementaldecoderRRRRRR(Rtmake_decoderR((s/usr/lib/python2.6/io.pyt_get_decoders
	cCs||_d|_dS(uSet the _decoded_chars buffer.iN(RR(Rtchars((s/usr/lib/python2.6/io.pyt_set_decoded_charss	cCsT|i}|djo|i|}n|i|||!}|it|7_|S(u'Advance into the _decoded_chars buffer.N(RRRR(RR\toffsetR((s/usr/lib/python2.6/io.pyt_get_decoded_charss	
cCs3|i|jotdn|i|8_dS(u!Rewind the _decoded_chars buffer.u"rewind decoded_chars out of boundsN(RtAssertionError(RR\((s/usr/lib/python2.6/io.pyt_rewind_decoded_charsscCs|idjotdn|io|ii\}}n|ii|i}|}|i|ii	|||io|||f|_
n|S(ur
        Read and decode the next chunk of data from the BufferedReader.

        The return value is True unless EOF was reached.  The decoded string
        is placed in self._decoded_chars (replacing its previous value).
        The entire input chunk is sent to the decoder, though some of it
        may remain buffered in the decoder, yet to be converted.
        u
no decoderN(RRRRRR4Rt_CHUNK_SIZERRR(Rt
dec_buffert	dec_flagstinput_chunkteof((s/usr/lib/python2.6/io.pyt_read_chunks


icCs*||d>B|d>B|d>Bt|d>BS(Ni@iii(R(RtpositionRt
bytes_to_feedtneed_eoft
chars_to_skip((s/usr/lib/python2.6/io.pyt_pack_cookie2scCsgt|d\}}t|d\}}t|d\}}t|d\}}|||||fS(Nii@llll(tdivmod(RtbiginttrestRRRRR((s/usr/lib/python2.6/io.pyt_unpack_cookie<s
cCs$|iptdn|iptdn|i|ii}|i}|djp|idjo|i	ot
dn|S|i\}}|t|8}|i}|djo|i
||S|i}z+|id|f|}|dd}}	}
d}x|D]}|	d7}	|
t|i|7}
|i\}
}|
o9|
|jo,||	7}||
8}|dd}}	}
n|
|joPq!q!W|
t|iddt7}
d}|
|jotdn|i
|||	||SWd|i|XdS(	Nu!underlying stream is not seekableu(telling position disabled by next() callupending decoded textiRiRu'can't reconstruct logical file position(RRRRIR4RGRRRRRRRRRRRR(RRRRt
next_inputRtsaved_statet	start_poststart_flagst	bytes_fedt
chars_decodedRt	next_byteR((s/usr/lib/python2.6/io.pyRGCsP


	
	




	
cCs7|i|djo|i}n|ii|S(N(RIRRGR4RH(RRD((s/usr/lib/python2.6/io.pyRHs

c
Cs^|iotdn|iptdn|djo3|djotdnd}|i}n|djor|djotdn|i|iidd}|idd|_
|io|iin|S|djotd	|fn|djotd
|fn|i|i
|\}}}}}|ii||idd|_
|ip|p|oB|ip
|i|_|iid|f|df|_
n|op|ii|}	|i|ii|	|||	f|_
t|i|jotdn||_n|S(
Nutell on closed fileu!underlying stream is not seekableiiu#can't do nonzero cur-relative seeksiu#can't do nonzero end-relative seeksuu(invalid whence (%r, should be 0, 1 or 2)unegative seek position %rRu#can't restore logical file position(RTRRRRGRIR4RFRRRRRRRRRbRRRR(
RtcookieRERRRRRRR((s/usr/lib/python2.6/io.pyRFsT







	




	
cCs|djo
d}n|ip
|i}|djoC|i|i|iidt}|idd|_	|St
}|i|}xJt||jo6|o.|i}||i|t|7}qW|SdS(NiiRu(
RRRRRR4RbRRRRRR(RR\RtresultR((s/usr/lib/python2.6/io.pyRbs 


	
	
"cCs?t|_|i}|pd|_|i|_tn|S(N(RRRgRRRRi(RRj((s/usr/lib/python2.6/io.pyRks		
c
Cs|iotdn|djo
d}nt|ttfptdn|i}d}|ip
|i	}d}}xt
o|io>|id|}|djo|d}Pqt
|}n|io|id|}|id|}|djo,|djot
|}q|d}Pq|djo|d}Pq||jo|d}Pq||djo|d}Pq|d}Pn8|i|i}|djo|t
|i}Pn|djot
||jo|}Pnd	}	x!|io|ioPqqW|io||i7}q|id	d|_|SqW|djo||jo
|}n|it
|||| S(
Nuread from closed fileiulimit must be an integeriu
iu
iu(RTRRRRR`RRRRRRRYRRRRRRRR(
RR]RjtstartRRDtendpostnlpostcrpost	more_line((s/usr/lib/python2.6/io.pyRgst

















 




		
cCs|io|iiSdS(N(RRR(R((s/usr/lib/python2.6/io.pyR6sN($R	R
RRRRRRvR&R'R2RMRPRRRIRKRTRBRRRqRRRRRRRRRGRHRFRbRkRgR(((s/usr/lib/python2.6/io.pyR"[sB	3											
		!			>;		WtStringIOcBs,eZdZdddddZdZRS(uAn in-memory stream for text. The initial_value argument sets the
    value of object. The other arguments are like those of TextIOWrapper's
    constructor.
    uuutf-8ustrictu
cCstt|itd|d|d||djo
t|_n|o>t|tpt|}n|i	||i
dndS(NR&R'R(i(tsuperRRRRRRRRRqRF(Rt
initial_valueR&R'R(((s/usr/lib/python2.6/io.pyRAs


cCs)|i|iii|i|iS(N(RIR4RRRR(R((s/usr/lib/python2.6/io.pyRQs
(R	R
RRR(((s/usr/lib/python2.6/io.pyR:s(+Rt
__future__RRt
__author__t__all__RRsRR|RRttypeRuRRRRR5R6R:RR?tobjectR@RwR}RRRRRRRR!R RRRRRR"R(((s/usr/lib/python2.6/io.pyt<module>#sR
		
		7HMg }WB@0L

ACC SHELL 2018