403Webshell
Server IP : 192.158.238.246  /  Your IP : 3.147.13.233
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3.6/site-packages/serial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/serial/__pycache__/serialutil.cpython-36.pyc
3

M�]W�J�"@s�ddlZddlZyeWn(eefk
r@Gdd�de�ZYnXyeWneefk
rfeZYnXyeWneefk
r�efZYnXdd�Z	dd�Z
e
dg�Ze
d	g�Ze
d
g�Z
e
dg�Zd,\ZZZZZd-\ZZZd.\ZZZZededededediZGdd�de�ZGdd �d e�Zed!�Zed"�Z Gd#d$�d$ej!�Z"e#d%k�r�ddl$Z$e"�Z%e$j&j'd&j(e%j)��e$j&j'd'j(e%j*��e$j&j'd(j(e%j+��e$j&j'd)j(e%j,��e$j&j'd*j(e%j-��e$j&j'd+j(e%��dS)/�Nc@seZdZdS)�
memoryviewN)�__name__�
__module__�__qualname__�rr� /usr/lib/python3.6/serialutil.pyrsrccsFt|t�r|j�}d}x*|||d�}|d7}|r<|VqPqWdS)z=Iterate over bytes, returning bytes instead of ints (python3)r�N)�
isinstancer�tobytes)�b�i�arrr�	iterbytes&s
rcCs�t|t�r|St|t�r t|�St|t�r2|j�St|t�rLtdj|���n8t�}x(|D] }t|t�rnt|�}|j	|�qXWt|�SdS)z"convert a sequence to a bytes typez?unicode strings are not supported, please encode to bytes: {!r}N)
r	�bytes�	bytearrayrr
�unicode�	TypeError�format�ord�append)�seqr�itemrrr�to_bytes6s





r���
�
�N�E�O�M�Sr��?������NoneZEvenZOddZMarkZSpacec@seZdZdZdS)�SerialExceptionz.Base class for serial port related exceptions.N)rrr�__doc__rrrrr)_sr)c@seZdZdZdS)�SerialTimeoutExceptionz Write timeouts give an exceptionN)rrrr*rrrrr+csr+z
Write timeoutz)Attempting to use a port that is not openc@s�eZdZdZd�ZeeeefZ	e
eee
efZeeefZd dee
ed d!d!d d!d fd"d#�Zed$d%��Zejd&d%��Zed'd(��Zejd)d(��Zed*d+��Zejd,d+��Zed-d.��Zejd/d.��Zed0d1��Zejd2d1��Zed3d4��Zejd5d4��Zed6d7��Zejd8d7��Zed9d:��Zejd;d:��Zed<d=��Zejd>d=��Zed?d@��Z e jdAd@��Z edBdC��Z!e!jd�dDdC��Z!edEdF��Z"e"jdGdF��Z"edHdI��Z#e#jdJdI��Z#edKdL��Z$e$jdMdL��Z$edNdO��Z%e%jdPdO��Z%d�Z&d[d\�Z'd]d^�Z(d_d`�Z)dadb�Z*dcdd�Z+dedf�Z,dgdh�Z-didj�Z.dkdl�Z/d�dndo�Z0dpdq�Z1drds�Z2dtdu�Z3d�dvdw�Z4d�dydz�Z5d�d{d|�Z6d}d~�Z7dd��Z8d�d��Z9d�d��Z:d�d��Z;ed�d���Z<e<jd�d���Z<ed�d���Z=e=jd�d���Z=d�d��Z>d�d��Z?d�d��Z@d�d��ZAeBd fd�d��ZCd�d��ZDd S)��
SerialBasezh    Serial port base class. Provides __init__ function and properties to
    get/set port settings.
    �2�K�n�����,�X���`	��%�K���������� �����@B���`�逄�%&��-��g5�	=NFc
Ks�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_||_||_||_||_||_||_|	|_||_||_|
|_||_d|kr�|jd�|_d|kr�|jd�|_|r�tdj|���|dk	r�|j �dS)z�        Initialize comm port object. If a "port" is given, then the port will be
        opened immediately. Otherwise a Serial port object in closed state
        is returned.
        FNT�writeTimeout�interCharTimeoutz"unexpected keyword arguments: {!r})!�is_open�portstr�name�_port�	_baudrate�	_bytesize�_parity�	_stopbits�_timeout�_write_timeout�_xonxoff�_rtscts�_dsrdtr�_inter_byte_timeout�_rs485_mode�
_rts_state�
_dtr_state�_break_state�port�baudrate�bytesize�parity�stopbits�timeout�
write_timeout�xonxoff�rtscts�dsrdtr�inter_byte_timeout�pop�
ValueErrorr�open)
�selfr_r`rarbrcrdrfrgrerhri�kwargsrrr�__init__zsJzSerialBase.__init__cCs|jS)z{        Get the current port setting. The value that was passed on init or using
        setPort() is passed back.
        )rP)rmrrrr_�szSerialBase.portcCs\|dk	r&t|t�r&tdjt|����|j}|r8|j�||_||_|j|_	|rX|j
�dS)z!        Change the port.
        Nz'"port" must be None or a string, not {})r	�
basestringrkr�typerM�closerNrPrOrl)rmr_Zwas_openrrrr_�scCs|jS)z"Get the current baud rate setting.)rQ)rmrrrr`�szSerialBase.baudratecCs^yt|�}Wn"tk
r.tdj|���Yn,X|dkrFtdj|���||_|jrZ|j�dS)z�        Change baud rate. It raises a ValueError if the port is open and the
        baud rate is not possible. If the port is closed, then the value is
        accepted and the exception is raised when the port is opened.
        zNot a valid baudrate: {!r}rN)�intrrkrrQrM�_reconfigure_port)rmr`rrrrr`�scCs|jS)z"Get the current byte size setting.)rR)rmrrrra�szSerialBase.bytesizecCs0||jkrtdj|���||_|jr,|j�dS)zChange byte size.zNot a valid byte size: {!r}N)�	BYTESIZESrkrrRrMrt)rmrarrrra�s

cCs|jS)zGet the current parity setting.)rS)rmrrrrb�szSerialBase.paritycCs0||jkrtdj|���||_|jr,|j�dS)zChange parity setting.zNot a valid parity: {!r}N)�PARITIESrkrrSrMrt)rmrbrrrrbs

cCs|jS)z"Get the current stop bits setting.)rT)rmrrrrcszSerialBase.stopbitscCs0||jkrtdj|���||_|jr,|j�dS)zChange stop bits size.zNot a valid stop bit size: {!r}N)�STOPBITSrkrrTrMrt)rmrcrrrrcs

cCs|jS)z Get the current timeout setting.)rU)rmrrrrdszSerialBase.timeoutcCsf|dk	rNy|dWn"tk
r6tdj|���YnX|dkrNtdj|���||_|jrb|j�dS)zChange timeout setting.NrzNot a valid timeout: {!r}r)rrkrrUrMrt)rmrdrrrrdscCs|jS)z Get the current timeout setting.)rV)rmrrrre,szSerialBase.write_timeoutcCsf|dk	rN|dkrtdj|���y|dWn"tk
rLtdj|���YnX||_|jrb|j�dS)zChange timeout setting.NrzNot a valid timeout: {!r}r)rkrrrVrMrt)rmrdrrrre1scCs|jS)z0Get the current inter-character timeout setting.)rZ)rmrrrri@szSerialBase.inter_byte_timeoutcCsf|dk	rN|dkrtdj|���y|dWn"tk
rLtdj|���YnX||_|jrb|j�dS)z"Change inter-byte timeout setting.NrzNot a valid timeout: {!r}r)rkrrrZrMrt)rmZ
ic_timeoutrrrriEscCs|jS)z!Get the current XON/XOFF setting.)rW)rmrrrrfTszSerialBase.xonxoffcCs||_|jr|j�dS)zChange XON/XOFF setting.N)rWrMrt)rmrfrrrrfYscCs|jS)z-Get the current RTS/CTS flow control setting.)rX)rmrrrrg`szSerialBase.rtsctscCs||_|jr|j�dS)z$Change RTS/CTS flow control setting.N)rXrMrt)rmrgrrrrgescCs|jS)z-Get the current DSR/DTR flow control setting.)rY)rmrrrrhlszSerialBase.dsrdtrcCs*|dkr|j|_n||_|jr&|j�dS)z#Change DsrDtr flow control setting.N)rXrYrMrt)rmrhrrrrhqs

cCs|jS)N)r\)rmrrr�rts}szSerialBase.rtscCs||_|jr|j�dS)N)r\rMZ_update_rts_state)rm�valuerrrrx�scCs|jS)N)r])rmrrr�dtr�szSerialBase.dtrcCs||_|jr|j�dS)N)r]rMZ_update_dtr_state)rmryrrrrz�scCs|jS)N)r^)rmrrr�break_condition�szSerialBase.break_conditioncCs||_|jr|j�dS)N)r^rMZ_update_break_state)rmryrrrr{�scCs|jS)z�        Enable RS485 mode and apply new settings, set to None to disable.
        See serial.rs485.RS485Settings for more info about the value.
        )r[)rmrrr�
rs485_mode�szSerialBase.rs485_modecCs||_|jr|j�dS)N)r[rMrt)rmZrs485_settingsrrrr|�sr`rarbrcrfrhrgrdrericst�fdd��jD��S)zb        Get current port settings as a dictionary. For use with
        apply_settings().
        csg|]}|t�d|�f�qS)�_)�getattr)�.0�key)rmrr�
<listcomp>�sz+SerialBase.get_settings.<locals>.<listcomp>)�dict�_SAVED_SETTINGS)rmr)rmr�get_settings�szSerialBase.get_settingscCsBx<|jD]2}||kr||t|d|�krt||||�qWdS)z�        Apply stored settings from a dictionary returned from
        get_settings(). It's allowed to delete keys from the dictionary. These
        values will simply left unchanged.
        r}N)r�r~�setattr)rm�dr�rrr�apply_settings�szSerialBase.apply_settingscCsdj|jjt|�|d�S)zAString representation of the current port settings and its state.z�{name}<id=0x{id:x}, open={p.is_open}>(port={p.portstr!r}, baudrate={p.baudrate!r}, bytesize={p.bytesize!r}, parity={p.parity!r}, stopbits={p.stopbits!r}, timeout={p.timeout!r}, xonxoff={p.xonxoff!r}, rtscts={p.rtscts!r}, dsrdtr={p.dsrdtr!r}))rO�id�p)r�	__class__rr�)rmrrr�__repr__�szSerialBase.__repr__cCsdS)NTr)rmrrr�readable�szSerialBase.readablecCsdS)NTr)rmrrr�writable�szSerialBase.writablecCsdS)NFr)rmrrr�seekable�szSerialBase.seekablecCsz|jt|��}t|�}y||d|�<WnNtk
rt}z2ddl}t||j�sP|�|jd|�|d|�<WYdd}~XnX|S)Nrr)�read�lenr�arrayr	)rmr�data�n�errr�rrr�readinto�s&zSerialBase.readintocCs|S)Nr)rmrrr�	__enter__�szSerialBase.__enter__cOs|j�dS)N)rr)rm�argsrnrrr�__exit__�szSerialBase.__exit__��?cCs$|js
t�d|_tj|�d|_dS)za        Send break condition. Timed, returns to idle state after given
        duration.
        TFN)rM�portNotOpenErrorr{�timeZsleep)rm�durationrrr�
send_break�s

zSerialBase.send_breakcCs|j�dS)N)Zreset_input_buffer)rmrrr�
flushInput�szSerialBase.flushInputcCs|j�dS)N)Zreset_output_buffer)rmrrr�flushOutputszSerialBase.flushOutputcCs|jS)N)�
in_waiting)rmrrr�	inWaitingszSerialBase.inWaitingcCs|j|�dS)N)r�)rmr�rrr�	sendBreakszSerialBase.sendBreakrcCs
||_dS)N)rx)rmryrrr�setRTSszSerialBase.setRTScCs
||_dS)N)rz)rmryrrr�setDTRszSerialBase.setDTRcCs|jS)N)Zcts)rmrrr�getCTSszSerialBase.getCTScCs|jS)N)Zdsr)rmrrr�getDSRszSerialBase.getDSRcCs|jS)N)Zri)rmrrr�getRIszSerialBase.getRIcCs|jS)N)Zcd)rmrrr�getCDszSerialBase.getCDcCs
||_dS)N)r_)rmr_rrr�setPortszSerialBase.setPortcCs|jS)N)re)rmrrrrK szSerialBase.writeTimeoutcCs
||_dS)N)re)rmrdrrrrK$scCs|jS)N)ri)rmrrrrL(szSerialBase.interCharTimeoutcCs
||_dS)N)ri)rmrLrrrrL,scCs|j�S)N)r�)rmrrr�getSettingsDict0szSerialBase.getSettingsDictcCs|j|�dS)N)r�)rmr�rrr�applySettingsDict3szSerialBase.applySettingsDictcCs|jS)N)rM)rmrrr�isOpen6szSerialBase.isOpencCs|j|j�S)zL        Read all bytes currently available in the buffer of the OS.
        )r�r�)rmrrr�read_all<szSerialBase.read_allcCs`t|�}t�}xH|jd�}|rR||7}||d�|kr:P|dk	rTt|�|krTPqPqWt|�S)z�        Read until a termination sequence is found ('
' by default), the size
        is exceeded or until timeout occurs.
        rN)r�rr�r)rm�
terminator�sizeZlenterm�line�crrr�
read_untilBs
zSerialBase.read_untilcos"x|j||�}|sP|VqWdS)zs        Read lines, implemented as generator. It will raise StopIteration on
        timeout (empty read).
        N)r�)rmr�rnr�rrr�iread_untilUs
zSerialBase.iread_until)r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJ)N)
r`rarbrcrfrhrgrdreri)r�)r�)r)r)Errrr*�	BAUDRATES�FIVEBITS�SIXBITS�	SEVENBITS�	EIGHTBITSru�PARITY_NONE�PARITY_EVEN�
PARITY_ODD�PARITY_MARK�PARITY_SPACErv�STOPBITS_ONE�STOPBITS_ONE_POINT_FIVE�STOPBITS_TWOrwro�propertyr_�setterr`rarbrcrdrerirfrgrhrxrzr{r|r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rKrLr�r�r�r��LFr�r�rrrrr,ks�
;				



r,�__main__zport name:  {}
zbaud rates: {}
zbyte sizes: {}
zparities:   {}
zstop bits:  {}
z{}
)rrrr r!)rr"r#)r$r%r&r').�ior�r�	NameError�AttributeError�objectr�strrprrZXONZXOFFZCRr�r�r�r�r�r�r�r�r�r�r�r�r�ZPARITY_NAMES�IOErrorr)r+ZwriteTimeoutErrorr��	RawIOBaser,r�sys�s�stdout�writerrOr�rurvrwrrrr�<module>
sX





z


Youez - 2016 - github.com/yon3zu
LinuXploit