HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //lib/python3.9/site-packages/rhn/__pycache__/SmartIO.cpython-39.pyc
a

U��Zt�@sVdZddlZzddlmZWney:ddlmZYn0Gdd�d�Zdd�ZdS)	z*
This module implements the SmartIO class
�N)�StringIO)�BytesIOc@s:eZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�SmartIOa�
    The SmartIO class allows one to put a cap on the memory consumption.
    StringIO objects are very fast, because they are stored in memory, but
    if they are too big the memory footprint becomes noticeable.
    The write method of a SmartIO determines if the data that is to be added
    to the (initially) StrintIO object does not exceed a certain threshold; if
    it does, it switches the storage to a temporary disk file
    �@rcCs$||_t�|_|rd|_nd|_dS)N�r)�
_max_mem_sizer�_io�_fixed)�self�max_mem_sizeZ	force_mem�r�//usr/lib/python3.9/site-packages/rhn/SmartIO.py�__init__s
zSmartIO.__init__cCs
||_dS�N�r)r
rrrr
�set_max_mem_size'szSmartIO.set_max_mem_sizecCs|jSrr)r
rrr
�get_max_mem_size*szSmartIO.get_max_mem_sizecCsP|js@t|�|j��|jkr@t�}|�|j���d|_||_|j�|�dS)Nr)r	�lenr�tellr�	_tempfile�write�getvalue)r
�dataZtmpfilerrr
r-sz
SmartIO.writecCst|j|�Sr)�getattrr)r
�namerrr
�__getattr__9szSmartIO.__getattr__N)rr)	�__name__�
__module__�__qualname__�__doc__rrrrrrrrr
rs
rcCs6ddl}|jdt��d�\}}t�|�t�|d�S)Nrz_rhn_transports-%d-)�prefixzwb+)�tempfileZmkstemp�os�getpid�unlink�fdopen)r!�fd�fnamerrr
r=s�
r)	rr"Z	cStringIOr�ImportError�iorrrrrrr
�<module>s+