403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/mercurial/revlogutils/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/mercurial/revlogutils/__pycache__/randomaccessfile.cpython-39.pyc
a

�+�bA�@sLddlZddlmZddlmZmZdZed�Zdd�ZGd	d
�d
e	�Z
dS)�N�)�_)�error�utilisCpartial read of revlog %s; expected %d bytes from offset %d, got %dcCs||d@dko|dkS)N�r�)�nrr�L/usr/lib64/python3.9/site-packages/mercurial/revlogutils/randomaccessfile.py�_is_power_of_twosr
c@sfeZdZdZddd�Zdd�Zddd	�Zejdd
d��Z	ejdd
��Z
ddd�Zddd�Zdd�Z
dS)�randomaccessfilezDAccessing arbitrary chuncks of data within a file, with some cachingNcCsJt|�sJ�||_||_||_d|_d|_d|_d|_|rF|\|_|_dS�N�r)r
�opener�filename�default_cached_chunk_size�writing_handle�reading_handle�
_cached_chunk�_cached_chunk_position)�selfrrrZ
initial_cacherrr	�__init__szrandomaccessfile.__init__cCsd|_d|_dSr)rr)rrrr	�clear_cache1szrandomaccessfile.clear_cache�rcCs|j|j|d�S)zReturn a file object)�mode)rr)rrrrr	�_open5szrandomaccessfile._openccsb|dur|VnN|jr |jVn>|jr0|jVn.|���}|VWd�n1sT0YdS)z%File object suitable for reading dataN)rrr)r�existing_file_obj�fprrr	�
_open_read9s


zrandomaccessfile._open_readc	csr|jdurh|jdurh|jdurh|���0}||_zdVWd|_nd|_0Wd�qn1s\0YndVdS)z4Context manager that keeps the file open for readingN)rrrr)rrrrr	�readingOs���
0zrandomaccessfile.readingcCsh||}|j}|t|j�}||krZ||krZ||krB||krB|jS||}t�|j||�S|�|||�S)a�Read a chunk of bytes from the file.

        Accepts an absolute offset, length to read, and an optional existing
        file handle to read from.

        If an existing file handle is passed, it will be seeked and the
        original seek position will NOT be restored.

        Returns a str or buffer of raw byte data.

        Raises if the requested number of bytes could not be read.
        )r�lenrr�buffer�_read_and_update_cache)r�offset�lengthr�endZcache_startZ	cache_endZrelative_startrrr	�
read_chunk`s
zrandomaccessfile.read_chunkcCs�||jd@}|||j|jd@|}|�|��$}|�|�|�|�}Wd�n1sb0Y|�||�||}t|�|}	|	|kr�t|j|||	f}
t�	|
��||ks�||kr�t
�|||�S|S)Nr)rr�seek�read�_add_cached_chunkr�PARTIAL_READ_MSGrrZRevlogErrorrr )rr"r#rZreal_offsetZreal_lengthZfile_obj�dataZrelative_offsetZgot�messagerrr	r!ys$
��
(
z'randomaccessfile._read_and_update_cachecCsJ|jt|j�|kr:t|j�t|�tkr:|j|7_n||_||_dS)z|Add to or replace the cached data chunk.

        Accepts an absolute offset and the data that is at that location.
        N)rrr�_MAX_CACHED_CHUNK_SIZE)rr"r*rrr	r(�s��z"randomaccessfile._add_cached_chunk)N)r)N)N)N)�__name__�
__module__�__qualname__�__doc__rrr�
contextlib�contextmanagerrrr%r!r(rrrr	rs�




r)r1Zi18nr�rrr,r)r
�objectrrrrr	�<module>s�

Youez - 2016 - github.com/yon3zu
LinuXploit