Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
ó
°‹EYc@szddlmZmZmZmZmZddlmZmZm	Z	m
Z
mZddlm
Z
de
fd„ƒYZdS(iÿÿÿÿ(tlinefeed_byte_valuetcrlftcr_bytet
linefeed_bytet
cr_byte_value(tBytesIOtPY2tutbytes_typest	text_type(tClosingContextManagertBufferedFilecBs[eZdZdZdZdZdZdZdZdZ	dZ
dZdZd	Z
d
„Zd„Zd„Zd
„Zd„Zerd„Zn	d„Zd„Zd„Zd„Zd„Zd&d„Zd&d„Zd&d„Zdd„Zd„Zd„Z d„Z!d„Z"e#d„ƒZ$d„Z%d„Z&d „Z'd!d"d#„Z(d$„Z)d%„Z*RS('sc
    Reusable base class to implement Python-style file buffering around a
    simpler stream.
    i iiiiii i@i€cCsed|_d|_|j|_tƒ|_tƒ|_t	|_
t	|_d|_|_
d|_dS(Ni(tNonetnewlinest_flagst_DEFAULT_BUFSIZEt_bufsizeRt_wbuffertbytest_rbuffertFalset_at_trailing_crt_closedt_post_realpost_size(tself((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyt__init__.s				cCs|jƒdS(N(tclose(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyt__del__=scCs|jrtdƒ‚n|S(sý
        Returns an iterator that can be used to iterate over the lines in this
        file.  This iterator happens to return the file itself, since a file is
        its own iterator.

        :raises: ``ValueError`` -- if the file is closed.
        sI/O operation on closed file(Rt
ValueError(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyt__iter__@s	cCs|jƒt|_dS(sN
        Close the file.  Future read and write operations will fail.
        N(tflushtTrueR(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyRLs
cCs&|j|jjƒƒtƒ|_dS(s{
        Write out any data in the write buffer.  This may do nothing if write
        buffering is not turned on.
        N(t
_write_allRtgetvalueR(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyR SscCs|jƒ}|st‚n|S(s\
            Returns the next line from the input, or raises
            ``StopIteration`` when EOF is hit.  Unlike Python file
            objects, it's okay to mix calls to `next` and `readline`.

            :raises: ``StopIteration`` -- when the end of the file is reached.

            :returns: a line (`str`) read from the file.
            (treadlinet
StopIteration(Rtline((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pytnext]s
	cCs|jƒ}|st‚n|S(s^
            Returns the next line from the input, or raises ``StopIteration``
            when EOF is hit.  Unlike python file objects, it's okay to mix
            calls to `.next` and `.readline`.

            :raises: ``StopIteration`` -- when the end of the file is reached.

            :returns: a line (`str`) read from the file.
            (R$R%(RR&((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyt__next__ls
	cCs|j|j@|jkS(s±
        Check if the file can be read from.

        :returns:
            `True` if the file can be read from. If `False`, `read` will raise
            an exception.
        (Rt	FLAG_READ(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pytreadable{scCs|j|j@|jkS(s´
        Check if the file can be written to.

        :returns:
            `True` if the file can be written to. If `False`, `write` will
            raise an exception.
        (Rt
FLAG_WRITE(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pytwritable…scCstS(s½
        Check if the file supports random access.

        :returns:
            `True` if the file supports random access. If `False`, `seek` will
            raise an exception.
        (R(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pytseekablescCs/|jt|ƒƒ}||t|ƒ*t|ƒS(s°
        Read up to ``len(buff)`` bytes into ``bytearray`` *buff* and return the
        number of bytes read.

        :returns:
            The number of bytes read.
        (treadtlen(Rtbufftdata((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pytreadinto™scCsX|jrtdƒ‚n|j|j@s7tdƒ‚n|dksO|dkr|j}tƒ|_|jt|ƒ7_xt	ry|j
|jƒ}Wntk
r±d}nX|dksÐt|ƒdkrÔPn||7}|j
t|ƒ7_
|jt|ƒ7_q|W|S|t|jƒkr[|j| }|j||_|jt|ƒ7_|SxÄt|jƒ|kr!|t|jƒ}|j|j@r«t|j|ƒ}ny|j
|ƒ}Wntk
r×d}nX|dksöt|ƒdkrúPn|j|7_|j
t|ƒ7_
q^W|j| }|j||_|jt|ƒ7_|S(s™
        Read at most ``size`` bytes from the file (less if we hit the end of
        the file first).  If the ``size`` argument is negative or omitted,
        read all the remaining data in the file.

        .. note::
            ``'b'`` mode flag is ignored (``self.FLAG_BINARY`` in
            ``self._flags``), because SSH treats all files as binary, since we
            have no idea what encoding the file is in, or even if the file is
            text data.

        :param int size: maximum number of bytes to read
        :returns:
            data read from the file (as bytes), or an empty string if EOF was
            encountered immediately
        sFile is closedsFile is not open for readingiN(RtIOErrorRR)RRRRR/R!t_readRtEOFErrorRt
FLAG_BUFFEREDtmaxR(Rtsizetresulttnew_datat	read_size((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyR.¥sP			






c

Cs•|jrtdƒ‚n|j|j@s7tdƒ‚n|j}t}x´trü|jr½|j|j@r½t	|ƒdkr½|dt
kr¤|d}|jtƒn
|jt
ƒt|_n|dk	r|dkrt	|ƒ|kr|||_|| }t}Pn|t	|ƒ}n	|j}t|ksL|j|j@rPt
|krPPny|j|ƒ}Wntk
r|d}nX|dks›t	|ƒdkrÚtƒ|_|jt	|ƒ7_|j|j@rÐ|St|ƒS||7}|jt	|ƒ7_qIW|jtƒ}|j|j@r[|jt
ƒ}|dkr[||ksO|dkr[|}q[n|dkrš|jt	|ƒ7_|j|j@r|St|ƒS|d}||tkrã|t	|ƒkrã||t
krã|d7}n|r|||j|_n
|||_|||!}	|| t}t	|jƒdkrU|	t
krUt|_n
|j|	ƒ|jt	|ƒ7_|j|j@r‹|St|ƒS(sÍ
        Read one entire line from the file.  A trailing newline character is
        kept in the string (but may be absent when a file ends with an
        incomplete line).  If the size argument is present and non-negative, it
        is a maximum byte count (including the trailing newline) and an
        incomplete line may be returned.  An empty string is returned only when
        EOF is encountered immediately.

        .. note::
            Unlike stdio's ``fgets``, the returned string contains null
            characters (``'\0'``) if they occurred in the input.

        :param int size: maximum length of returned string.
        :returns:
            next line of the file, or an empty string if the end of the
            file has been reached.

            If the file was opened in binary (``'b'``) mode: bytes are returned
            Else: the encoding of the file is assumed to be UTF-8 and character
            strings (`str`) are returned
        sFile is closedsFile not open for readingiiiÿÿÿÿN(RR3RR)RRR!RtFLAG_UNIVERSAL_NEWLINER/Rt_record_newlineRRRRRR4R5RRtFLAG_BINARYRRtfindR(
RR8R&t	truncatedtnR:tpostrpostxpostlf((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyR$àsx				



	


$



!
cCsxg}d}xetrs|jƒ}t|ƒdkr7Pn|j|ƒ|t|ƒ7}|dk	r||krPqqW|S(s°
        Read all remaining lines using `readline` and return them as a list.
        If the optional ``sizehint`` argument is present, instead of reading up
        to EOF, whole lines totalling approximately sizehint bytes (possibly
        after rounding up to an internal buffer size) are read.

        :param int sizehint: desired maximum number of bytes to read.
        :returns: `list` of lines read from the file.
        iN(R!R$R/tappendR(Rtsizehinttlinest
byte_countR&((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyt	readlinesMs
	
cCstdƒ‚dS(s¬
        Set the file's current position, like stdio's ``fseek``.  Not all file
        objects support seeking.

        .. note::
            If a file is opened in append mode (``'a'`` or ``'a+'``), any seek
            operations will be undone at the next write (as the file position
            will move back to the end of the file).

        :param int offset:
            position to move to within the file, relative to ``whence``.
        :param int whence:
            type of movement: 0 = absolute; 1 = relative to the current
            position; 2 = relative to the end of the file.

        :raises: ``IOError`` -- if the file doesn't support random access.
        sFile does not support seeking.N(R3(Rtoffsettwhence((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pytseekcscCs|jS(sù
        Return the file's current position.  This may not be accurate or
        useful if the underlying file doesn't support random access, or was
        opened in append mode.

        :returns: file position (`number <int>` of bytes).
        (R(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyttellwscCsFt|tƒr!|jdƒ}n|jr9tdƒ‚n|j|j@sXtdƒ‚n|j|j@sy|j|ƒdS|j	j
|ƒ|j|j@r|jt
ƒ}|dkr|j	jƒ}|t|ƒt|ƒ7}|j||d ƒtƒ|_	|j	j
||dƒndS|j	jƒ|jkrB|jƒndS(s8
        Write data to the file.  If write buffering is on (``bufsize`` was
        specified and non-zero), some or all of the data may not actually be
        written yet.  (Use `flush` or `close` to force buffered data to be
        written out.)

        :param data: ``str``/``bytes`` data to write
        sutf-8sFile is closedsFile not open for writingNii(t
isinstanceR	tencodeRR3RR+R6R"RtwritetFLAG_LINE_BUFFEREDtrfindRR#R/RRNRR (RR1tlast_newline_postwbuf((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyRQs,		

cCs"x|D]}|j|ƒqWdS(s?
        Write a sequence of strings to the file.  The sequence can be any
        iterable object producing strings, typically a list of strings.  (The
        name is intended to match `readlines`; `writelines` does not add line
        separators.)

        :param sequence: an iterable sequence of strings.
        N(RQ(RtsequenceR&((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyt
writelines¥s	
cCs|S(s
        Identical to ``iter(f)``.  This is a deprecated file interface that
        predates Python iterator support.
        ((R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyt
xreadlines²scCs|jS(N(R(R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pytclosed¹scCs
tƒ‚dS(sˆ
        (subclass override)
        Read data from the stream.  Return ``None`` or raise ``EOFError`` to
        indicate EOF.
        N(R5(RR8((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyR4¿scCstdƒ‚dS(sI
        (subclass override)
        Write data into the stream.
        swrite not implementedN(R3(RR1((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyt_writeÇscCsdS(si
        (subclass override)
        Return the size of the file.  This is called from within `_set_mode`
        if the file is opened in append mode, so the file position can be
        tracked and `seek` and `tell` will work correctly.  If the file is
        a stream that can't be randomly accessed, you don't need to override
        this method,
        i((R((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyt	_get_sizeÎs	triÿÿÿÿcCs¢|j|_|dkr!d}n|dkrI|j|j|jBO_nf|dkr†||_|j|jO_|j|jM_n)|dkr¯|j|j|jBM_nd|ksÇd|krÜ|j|jO_nd|ksôd|kr	|j|jO_nd|krS|j|j|jBO_|jƒ|_	|j	|_
|_nd|krt|j|jO_nd|krž|j|j
O_d	|_nd	S(
sM
        Subclasses call this method to initialize the BufferedFile.
        iiR\t+twtatbtUN(RRRR6RRR)R+tFLAG_APPENDR[RRRR>R<RR
(Rtmodetbufsize((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyt	_set_modeÛs0		cCs‰x‚t|ƒdkr„|j|ƒ}||}|j|j@rc|j|7_|j|_|_q|j|7_|j|7_qWdS(Ni(R/RZRRbRRRR(RR1tcount((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyR"s
cCs|j|j@sdS|jdkr/||_nZ|j|kret|jtƒre|j|f|_n$||jkr‰|j|f7_ndS(N(RR<R
RROR(Rtnewline((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyR=sN(+t__name__t
__module__t__doc__RtSEEK_SETtSEEK_CURtSEEK_ENDR)R+RbR>R6RRR<RRRRR RR'R(R*R,R-R2RR.R$RJRMRNRQRWRXtpropertyRYR4RZR[ReR"R=(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyRsN								
	
	
	;m	
	$	
				
(	N(tparamiko.commonRRRRRtparamiko.py3compatRRRRR	t
paramiko.utilR
R(((sB/home/tvault/.virtenv/lib/python2.7/site-packages/paramiko/file.pyt<module>s((