-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/bzrlib/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyc

σ
¦ξNc@@seddlmZdefd„ƒYZdefd„ƒYZedkraddlZejƒndS(i(tabsolute_importtIterableFileBasecB@sGeZdZd„Zd„Zdd„Zd„Zd„Zd„Z	RS(s+Create a file-like object from any iterablecC@s2tj|ƒ|jƒ|_d|_t|_dS(Nt(tobjectt__init__t__iter__t_itert_buffertFalsetdone(tselftiterable((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyRs
	c@s‡fd†}|j|ƒS(sd
        >>> IterableFileBase(['This ', 'is ', 'a ', 'test.']).read_n(8)
        'This is '
        c@st|ƒˆkrˆSdSdS(N(tlentNone(tresult(tlength(s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyttest_length"s(t_read(R
RR((Rs7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pytread_nsc@s‡‡fd†}|j|ƒS(s«
        >>> f = IterableFileBase(['Th\nis ', 'is \n', 'a ', 'te\nst.'])
        >>> f.read_to('\n')
        'Th\n'
        >>> f.read_to('\n')
        'is is \n'
        c@sYˆdk	r%t|ƒˆkr%ˆSny|jˆƒtˆƒSWntk
rTdSXdS(N(R
Rtindext
ValueError(R(Rtsequence(s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyt
test_contents1s
(R(R
RRR((RRs7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pytread_to)scC@s|j}xT||ƒdkr_y||jjƒ7}Wqtk
r[t|_d|_|SXqW||ƒ}|||_|| S(sV
        Read data until result satisfies the condition result_length.
        result_length is a callable that returns None until the condition
        is satisfied, and returns the length of the result to use when
        the condition is satisfied.  (i.e. it returns the length of the
        subset of the first condition match.)
        RN(RR
Rtnextt
StopIterationtTrueR	(R
t
result_lengthRt
output_length((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyR;s	
			
cC@sd„}|j|ƒS(sl
        >>> IterableFileBase(['This ', 'is ', 'a ', 'test.']).read_all()
        'This is a test.'
        cS@sdS(N(R
(R((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pytno_stopTs(R(R
R((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pytread_allOs	cC@s||j|_dS(sΡ
        >>> f = IterableFileBase(['Th\nis ', 'is \n', 'a ', 'te\nst.'])
        >>> f.read_to('\n')
        'Th\n'
        >>> f.push_back("Sh")
        >>> f.read_all()
        'Shis is \na te\nst.'
        N(R(R
tcontents((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyt	push_backYs	N(
t__name__t
__module__t__doc__RRR
RRRR (((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyRs				
tIterableFilecB@sŒeZdZd„Zd„Zd„Zd„Zed„ƒZd„Z	d„Z
d„Zd
d	„Z
d
d
„Zd
d„Zd
d„ZRS(sEThis class supplies all File methods that can be implemented cheaply.cC@sAtj|ƒt|ƒ|_|jƒ|_t|_d|_dS(Ni(	RRRt
_file_baset_make_iteratorRRt_closedt	softspace(R
R((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyRgs

	cc@sGx@|jjsB|jƒ|jjdƒ}|dkr|VqqWdS(Ns
R(R%R	t
_check_closedR(R
R((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyR&ns

cC@s|jrtdƒ‚ndS(NsFile is closed.(tclosedR(R
((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyR)us	cC@st|j_t|_dS(s’
        >>> f = IterableFile(['This ', 'is ', 'a ', 'test.'])
        >>> f.closed
        False
        >>> f.close()
        >>> f.closed
        True
        N(RR%R	R'(R
((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pytcloseys	cC@s|jS(N(R'(tx((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyt<lambda>…scC@s|jƒdS(sΓNo-op for standard compliance.
        >>> f = IterableFile([])
        >>> f.close()
        >>> f.flush()
        Traceback (most recent call last):
        ValueError: File is closed.
        N(R)(R
((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pytflush‡scC@s|jƒ|jjƒS(sImplementation of the iterator protocol's next()

        >>> f = IterableFile(['This \n', 'is ', 'a ', 'test.'])
        >>> f.next()
        'This \n'
        >>> f.close()
        >>> f.next()
        Traceback (most recent call last):
        ValueError: File is closed.
        >>> f = IterableFile(['This \n', 'is ', 'a ', 'test.\n'])
        >>> f.next()
        'This \n'
        >>> f.next()
        'is a test.\n'
        >>> f.next()
        Traceback (most recent call last):
        StopIteration
        (R)RR(R
((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyR‘s
cC@s|S(s:
        >>> list(IterableFile(['Th\nis ', 'is \n', 'a ', 'te\nst.']))
        ['Th\n', 'is is \n', 'a te\n', 'st.']
        >>> f = IterableFile(['Th\nis ', 'is \n', 'a ', 'te\nst.'])
        >>> f.close()
        >>> list(f)
        Traceback (most recent call last):
        ValueError: File is closed.
        ((R
((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyR§s
cC@s7|jƒ|dkr#|jjƒS|jj|ƒSdS(sˆ
        >>> IterableFile(['This ', 'is ', 'a ', 'test.']).read()
        'This is a test.'
        >>> f = IterableFile(['This ', 'is ', 'a ', 'test.'])
        >>> f.read(10)
        'This is a '
        >>> f = IterableFile(['This ', 'is ', 'a ', 'test.'])
        >>> f.close()
        >>> f.read(10)
        Traceback (most recent call last):
        ValueError: File is closed.
        N(R)R
R%RR(R
R((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pytread³s

cC@s|jƒ|jj||ƒS(sΆ
        Read characters until a sequence is found, with optional max size.
        The specified sequence, if found, will be included in the result

        >>> f = IterableFile(['Th\nis ', 'is \n', 'a ', 'te\nst.'])
        >>> f.read_to('i')
        'Th\ni'
        >>> f.read_to('i')
        's i'
        >>> f.close()
        >>> f.read_to('i')
        Traceback (most recent call last):
        ValueError: File is closed.
        (R)R%R(R
Rtsize((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyRΖs
cC@s|jd|ƒS(s
        >>> f = IterableFile(['Th\nis ', 'is \n', 'a ', 'te\nst.'])
        >>> f.readline()
        'Th\n'
        >>> f.readline(4)
        'is i'
        >>> f.close()
        >>> f.readline()
        Traceback (most recent call last):
        ValueError: File is closed.
        s
(R(R
R0((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pytreadlineΨscC@s•g}xˆtr|jƒ}|dkr+|S|dkrG|j|ƒq	t|ƒ|kry|j|ƒ|t|ƒ8}q	|jj|ƒ|Sq	WdS(sX
        >>> f = IterableFile(['Th\nis ', 'is \n', 'a ', 'te\nst.'])
        >>> f.readlines()
        ['Th\n', 'is is \n', 'a te\n', 'st.']
        >>> f = IterableFile(['Th\nis ', 'is \n', 'a ', 'te\nst.'])
        >>> f.close()
        >>> f.readlines()
        Traceback (most recent call last):
        ValueError: File is closed.
        RN(RR1R
tappendRR%R (R
tsizehinttlinestline((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyt	readlinesζs	
N(R!R"R#RR&R)R+tpropertyR*R.RRR
R/RR1R6(((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyR$es					
		t__main__N(t
__future__RRRR$R!tdoctestttestmod(((s7/usr/lib/python2.7/dist-packages/bzrlib/iterablefile.pyt<module>s
Q›

Copyright © 2017 || Recoded By Mr.Bumblebee