HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python2.7/dist-packages/mercurial/byterange.pyc
ó
ÛXc@@szddlmZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
e
jZe
jZej
Z
ejZejZejZejZejZejZdefd„ƒYZdejfd„ƒYZd	efd
„ƒYZdejfd„ƒYZd
ejfd„ƒYZdejfd„ƒYZda d„Z!d„Z"d„Z#dS(i(tabsolute_importNi(tutilt
RangeErrorcB@seZdZRS(s6Error raised when an unsatisfiable range is requested.(t__name__t
__module__t__doc__(((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyR-stHTTPRangeHandlercB@s eZdZd„Zd„ZRS(s“Handler that enables HTTP Range headers.

    This was extremely simple. The Range header is a HTTP feature to
    begin with so all this class does is tell urllib2 that the
    "206 Partial Content" response from the HTTP server is what we
    expected.

    Example:
        import urllib2
        import byterange

        range_handler = range.HTTPRangeHandler()
        opener = urlreq.buildopener(range_handler)

        # install it
        urlreq.installopener(opener)

        # create Request and set Range header
        req = urlreq.request('http://www.python.org/')
        req.header['Range'] = 'bytes=30-50'
        f = urlreq.urlopen(req)
    cC@s1tj|||jƒƒ}||_||_|S(N(turlreqt
addinfourltget_full_urltcodetmsg(tselftreqtfpR
Rthdrstr((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pythttp_error_206Is		cC@stdƒ‚dS(NsRequested Range Not Satisfiable(R(RR
RR
RR((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pythttp_error_416Ps(RRRRR(((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyR1s	tRangeableFileObjectcB@sheZdZd„Zd„Zd„Zdd„Zdd„Zdd„Zd	„Z	d
„Z
d„ZRS(sFile object wrapper to enable raw range handling.
    This was implemented primarily for handling range
    specifications for file:// urls. This object effectively makes
    a file object look like it consists only of a range of bytes in
    the stream.

    Examples:
        # expose 10 bytes, starting at byte position 20, from
        # /etc/aliases.
        >>> fo = RangeableFileObject(file('/etc/passwd', 'r'), (20,30))
        # seek seeks within the range (to position 23 in this case)
        >>> fo.seek(3)
        # tell tells where your at _within the range_ (position 3 in
        # this case)
        >>> fo.tell()
        # read EOFs if an attempt is made to read past the last
        # byte in the range. the following will return only 7 bytes.
        >>> fo.read(30)
    cC@s>||_t|ƒ\|_|_d|_|j|jƒdS(s}Create a RangeableFileObject.
        fo       -- a file like object. only the read() method need be
                    supported but supporting an optimized seek() is
                    preferable.
        rangetup -- a (firstbyte,lastbyte) tuple specifying the range
                    to work over.
        The file object provided is assumed to be at byte offset 0.
        iN(tfotrange_tuple_normalizet	firstbytetlastbytetrealpost_do_seek(RRtrangetup((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyt__init__is			cC@st|j|ƒS(s«This effectively allows us to wrap at the instance level.
        Any attribute not found in _this_ object will be searched for
        in self.fo.  This includes methods.(tgetattrR(Rtname((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyt__getattr__wscC@s|j|jS(s4Return the position within the range.
        This is different from fo.seek in that position 0 is the
        first byte position of the range tuple. For example, if
        this object was created with a range tuple of (500,899),
        tell() will return 0 when at byte position 500 of the file.
        (RR(R((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyttell}sicC@s¡|dkst‚|dkr.|j|}n7|dkrJ|j|}n|dkretdƒ‚n|jr‰||jkr‰|j}n|j||jƒdS(seSeek within the byte range.
        Positioning is identical to that described under tell().
        iiis$seek from end of file not supported.N(iii(tAssertionErrorRRtIOErrorRR(Rtoffsettwhencet
realoffset((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pytseek†siÿÿÿÿcC@s:|j|ƒ}|jj|ƒ}|jt|ƒ7_|S(s`Read within the range.
        This method will limit the size read based on the range.
        (t_calc_read_sizeRtreadRtlen(Rtsizetrslt((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyR'™scC@s:|j|ƒ}|jj|ƒ}|jt|ƒ7_|S(sfRead lines within the range.
        This method will limit the size read based on the range.
        (R&RtreadlineRR((RR)R*((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyR+¢scC@sX|jrT|dkrA|j||jkrQ|j|j}qQqT|j|j}n|S(sSHandles calculating the amount of data to read based on
        the range.
        iÿÿÿÿ(RR(RR)((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyR&«s	cC@sN|dkst‚t|jd|jƒ}||j|ƒ|j|7_dS(sSeek based on whether wrapped object supports seek().
        offset is relative to the current position (self.realpos).
        iR%N(R RRt_poor_mans_seekR(RR"R%((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyR·scC@s}d}d}xj||krx|||kr8||}n|jj|ƒ}t|ƒ|krktdƒ‚n||7}qWdS(s®Seek by calling the wrapped file objects read() method.
        This is used for file like objects that do not have native
        seek support. The wrapped objects read() method is called
        to manually seek to the desired position.
        offset -- read this number of bytes from the wrapped
                  file object.
        raise RangeError if we encounter EOF before reaching the
        specified offset.
        iisRequested Range Not SatisfiableN(RR'R(R(RR"tpostbufsizetbuf((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyR,Às

(RRRRRRR%R'R+R&RR,(((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyRTs									tFileRangeHandlercB@seZdZd„ZRS(s~FileHandler subclass that adds Range support.
    This class handles Range headers exactly like an HTTP
    server would.
    cC@s·|jƒ}|jƒ}tj|ƒ}tj|ƒ}|tj}tjj	|tj
ƒ}tj|ƒd}|rÀtj
|ƒ\}}	|	s«tj|ƒ|jƒkrÀtjdƒ‚qÀnt|dƒ}
|jjddƒ}t|ƒ}|d
kst‚|r~|\}}
|
dkr)|}
n|dksM||ksM|
|kr\tdƒ‚n|
|}t|
||
fƒ}
ntjd|pd||fƒ}tj|
|d	|ƒS(Nisfile not on local hosttrbtRangetsRequested Range Not Satisfiables6Content-Type: %s
Content-Length: %d
Last-Modified: %s
s
text/plainsfile:((tget_hosttget_selectorRturl2pathnametoststattST_SIZEtemailtUtilst
formatdatetST_MTIMEt	mimetypest
guess_typet	splitporttsockett
gethostbynamet	get_namesturlerrturlerrortopentheaderstgettNonetrange_header_to_tupleR RRtmessage_from_stringR(RR
thosttfilet	localfiletstatsR)tmodifiedtmtypetportRtbrangetfbtlbRG((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pytopen_local_fileÙs6
!	$
(RRRRV(((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyR0ÔstFTPRangeHandlercB@seZd„Zd„ZRS(cC@s¢|jƒ}|s$tddƒ‚nt|ƒ\}}|dkrNtj}nt|ƒ}t|ƒ\}}|r‡t|ƒ\}}nd}t	|ƒ}t	|p¥dƒ}t	|p·dƒ}yt
j|ƒ}Wn%t
jk
r÷}t
j|ƒ‚nXt|jƒƒ\}}|jdƒ}	tt	|	ƒ}	|	d |	d}	}
|	ra|	dra|	d}	ny|j|||||	ƒ}|
rŽd}nd	}xM|D]E}
t|
ƒ\}
}|
jƒd
kr›|dkr›|jƒ}q›q›Wd}t|jjddƒƒ}|dkst‚|rA|\}}|dkrA|}qAn|j|
||ƒ\}}|rñ|\}}|dkrÏ|dks’|dkr¡tdƒ‚n|}||}|dkrîtdƒ‚qîqñ||}t|d|fƒ}nd}tj|jƒƒd}|r'|d|7}n|dk	rP|dkrP|d|7}nt j!|ƒ}t"|||jƒƒSWn%tj#k
r}td|ƒ‚nXdS(Ns	ftp errors
no host givenR3t/iÿÿÿÿiitItDttypetatAtitdR2s@Requested Range Not Satisfiable due to unobtainable file length.sRequested Range Not SatisfiablesContent-Type: %s
sContent-Length: %d
(R\R]R^RYR_RZ(($R4R!R@RItftplibtFTP_PORTtintt	splitusertsplitpasswdtunquoteRARBterrorRDREt	splitattrR5tsplittmaptconnect_ftptlowertupperRJRGRHR tretrfileRRR>R?R	R:RKRt
all_errors(RR
RLRRtusertpasswdRtpathtattrstdirsRMtfwR[tattrtvaluetrestt	range_tupRTRURtretrlenRGRQ((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pytftp_openÿs~
	


cC@st|||||ƒ}|S(N(t
ftpwrapper(RRoRpRLRRRsRt((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyRjRs(RRRzRj(((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyRWþs	SR{cB@seZdd„ZRS(c
C@sÿ|jƒ|dkr%d}d}nd|}d}y|jj|ƒWn.tjk
ry|jƒ|jj|ƒnXd}|r‹|r‹y|jj|ƒWn%tjk
rÈ}t	d|ƒ‚nX|jj|ƒy#d|}|jj
||ƒ}Wq‹tjk
r‡}t|ƒjd	ƒr]|j
||ƒ\}}	t||d
fƒ}||	fSt|ƒjdƒsˆt	d|ƒ‚qˆq‹Xn|sÏ|jjdƒ|r´d|}nd
}|jj
|ƒ}nd|_t|djdƒ|jƒ|dfS(NR_RZsTYPE AisTYPE is	ftp errorsRETR t501R3t550sLIST tLISTR1(R_RZ(tendtransfertftptvoidcmdR`RntinitRItnlstt
error_permR!tntransfercmdtstrt
startswithRmRtbusytaddclosehooktmakefile(
RRMR[RwtcmdtisdirtconntreasonRRy((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyRm[sJ
	





	N(RRRIRm(((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyR{VscC@sŽ|dkrdStdkr.tjdƒantj|ƒ}|rŠt|jddƒƒ}|r†|dr†|d|ddf}n|SdS(sËGet a (firstbyte,lastbyte) tuple from a Range header value.

    Range headers have the form "bytes=<firstbyte>-<lastbyte>". This
    function pulls the firstbyte and lastbyte values and returns
    a (firstbyte,lastbyte) tuple. If lastbyte is not specified in
    the header value, it is returned as an empty string in the
    tuple.

    Return None if range_header is None
    Return () if range_header does not conform to the range spec
    pattern.

    s^bytes=(\d{1,})-(\d*)iiiN((RIt_rangeretretcompiletmatchRtgroup(trange_headerR’ttup((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyRJ‘scC@sS|dkrdSt|ƒ}|rO|drG|d|ddf}nd|SdS(s•Convert a range tuple to a Range header value.
    Return a string of the form "bytes=<firstbyte>-<lastbyte>" or None
    if no range is needed.
    iisbytes=%s-%sN(RIR(Rx((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pytrange_tuple_to_header¬s
cC@sØ|dkrdS|d}|dkr/d}nt|ƒ}y|d}Wntk
rbd}n1X|dkrxd}n|dkr“t|ƒ}n||fdkr©dS||krÎtd||fƒ‚n||fS(s6Normalize a (first_byte,last_byte) range tuple.
    Return a tuple whose first element is guaranteed to be an int
    and whose second element will be '' (meaning: the last byte) or
    an int. Finally, return None if the normalized tuple == (0,'')
    as that is equivalent to retrieving the entire file.
    iR3isInvalid byte range: %s-%sN(NR3(iR3(RIRbt
IndexErrorR(RxRTRU((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyR¹s&
	

	($t
__future__RR:R`R>R7RRAR8R3RRDRR‰RRgRdR@RcReR!RtbasehandlerRtobjectRtfilehandlerR0t
ftphandlerRWR{RIRRJR–R(((s7/usr/lib/python2.7/dist-packages/mercurial/byterange.pyt<module>s6									#€*X: