403Webshell
Server IP : 146.190.157.162  /  Your IP : 216.73.217.6
Web Server : Apache
System : Linux ubuntu-s-2vcpu-4gb-amd-sfo3-01-KIT-DIGITAL 6.5.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 7 15:10:09 UTC 2024 x86_64
User : businessweek ( 639)
PHP Version : 8.2.10-2ubuntu2.2
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_signal,pcntl_signal_dispatch,pcntl_getpriority,pcntl_setpriority,dl,putenv,parse_ini_file,show_source
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/share/netplan/netplan_cli/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/netplan/netplan_cli/__pycache__/terminal.cpython-311.pyc
�

;�d����dZddlZddlZddlZddlZddlZGd�de��ZGd�de��Z	Gd�de��Z
dS)	z
Terminal / input handling
�Nc�H�eZdZdZd�Zd�Zd�Zd�Zd�Zdd	�Z	d
d
�Z
d
d�ZdS)�Terminalz@
    Do minimal terminal mangling to prompt users for input
    c�X�||_d|_d|_|���dS�N)�fd�
orig_flags�	orig_term�save)�selfrs  �*/usr/share/netplan/netplan_cli/terminal.py�__init__zTerminal.__init__"s(������������	�	������c�"�tj���rptj|j��}|dtjz|d<|dtjz|d<tj|jtj	|��dSdS�N��
�sys�stdin�isatty�termios�	tcgetattrr�ICANON�ECHO�	tcsetattr�TCSANOW�r�attrss  r�enable_echozTerminal.enable_echo(s{���9�����	?��%�d�g�.�.�E��Q�x�'�.�0�E�!�H��Q�x�'�,�.�E�!�H���d�g�w���>�>�>�>�>�		?�	?rc�&�tj���rrtj|j��}|dtjz|d<|dtjz|d<tj|jtj	|��dSdSrrrs  r�disable_echozTerminal.disable_echo/s���9�����	?��%�d�g�.�.�E��Q�x�7�>�/�1�E�!�H��Q�x�7�<�-�/�E�!�H���d�g�w���>�>�>�>�>�		?�	?rc��tj|jtj��}tj|jtj|tjz��dSr��fcntlr�F_GETFL�F_SETFL�os�
O_NONBLOCK�r�flagss  r�enable_nonblocking_iozTerminal.enable_nonblocking_io6s<����D�G�U�]�3�3��
��D�G�U�]�E�B�M�,A�B�B�B�B�Brc��tj|jtj��}tj|jtj|tjz��dSrr"r(s  r�disable_nonblocking_iozTerminal.disable_nonblocking_io:s>����D�G�U�]�3�3��
��D�G�U�]�E�R�]�N�,B�C�C�C�C�Cr�xNc
���td��t��}|�|��|���|���|sd}td�|����|}|dkr�td�|t
t|������d���tjtj
gggd��	tj
���}|d	kr#|�|��t���n#t$rYnwxYw|dz}|dk��|�|��t���)
a�
        Get a "confirmation" input from the user, for at most (timeout)
        seconds. Optionally, customize the message to be displayed.

        timeout -- timeout to wait for input (default 120)
        message -- optional customized message ("Press ENTER to (message)")

        raises:
        InputAccepted -- the user confirmed the changes
        InputRejected -- the user rejected the changes
        z%Do you want to keep these settings?

zaccept the new configurationz&Press ENTER before the timeout to {}

rz%Changes will revert in {:>{}} seconds�
)�end��
)�print�dictr
r r*�format�len�str�selectrr�read�reset�
InputAccepted�	TypeError�
InputRejected)r�timeout�message�settings�timeout_now�cs      r�get_confirmation_inputzTerminal.get_confirmation_input>sx��	�7�8�8�8��6�6���	�	�(�����������"�"�$�$�$��	5�4�G�
�8�?�?��H�H�I�I�I����Q����9�@�@��c�RU�V]�R^�R^�N_�N_�`�`�fj�k�k�k�k�
�M�3�9�+�r�2�q�1�1�1�
��I�N�N�$�$����I�I��J�J�x�(�(�(�'�/�/�)����
�
�
���	
����

�1��K�%�Q���.	
�
�
�8�����o�o�s�+AD3�3
E�?Ec��tj|jtj��}d}tj���rt
j|j��}|�|�||d���dS||_	||_
dS)z�
        Save the terminal's current attributes and flags

        Optional argument:
            - dest: if set, save settings to this dict
        N)r)�term)r#rr$rrrrr�updaterr	)r�destrr	s    rr
z
Terminal.saveps����[���%�-�8�8�
��	��9�����	3��)�$�'�2�2�I����K�K�*�!*�,�,�
-�
-�
-�
-�
-�)�D�O�&�D�N�N�Nrc�T�d}d}|�+|�d��}|�d��}n|j}|j}tj���r%t
j|jtj	|��tj
|jtj|��dS)z�
        Reset the terminal to its original attributes and flags

        Optional argument:
            - orig: if set, reset to settings from this dict
        NrEr))�getr	rrrrrrr�	TCSAFLUSHr#r%)r�origr	rs    rr:zTerminal.reset�s����	��
�������(�(�I����'�*�*�J�J���I���J��9�����	E���d�g�w�'8�)�D�D�D�
��D�G�U�]�J�7�7�7�7�7r)r-Nr)�__name__�
__module__�__qualname__�__doc__r
rr r*r,rCr
r:�rrrrs������������?�?�?�?�?�?�C�C�C�D�D�D�0�0�0�0�d'�'�'�'�$8�8�8�8�8�8rrc��eZdZdZdS)r;z Denotes has accepted inputN�rLrMrNrOrPrrr;r;�s������%�%��Drr;c��eZdZdZdS)r=z) Denotes that the user has rejected inputNrRrPrrr=r=�s������3�3��Drr=)rOr#r&rr8r�objectr�	Exceptionr;r=rPrr�<module>rVs���$��
����	�	�	�	�����
�
�
�
�
�
�
�
�v8�v8�v8�v8�v8�v�v8�v8�v8�r	�	�	�	�	�I�	�	�	�
	�	�	�	�	�I�	�	�	�	�	r

Youez - 2016 - github.com/yon3zu
LinuXploit