%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core22/current/usr/share/subiquity/subiquitycore/__pycache__/
Upload File :
Create Path :
Current File : //snap/core22/current/usr/share/subiquity/subiquitycore/__pycache__/screen.cpython-310.pyc

o

K��^��@s�ddlZddlZddlZddlZddlZddlZddlmZmZe�	d�Z
dZdZdZ
d\ZZZGdd	�d	ejj�ZGd
d�de�ZGdd
�d
e�Zdadd�Zddd�ZdS)�N)�COLORS�
urwid_8_nameszsubiquitycore.screeni3KipKiqK)���T� cs(eZdZ�fdd�Z�fdd�Z�ZS)�SubiquityScreencs@t���t�|tjj�|j��}t�	|�rt
�|�dSdS�N)�super�start�urwid�emit_signal�display_common�INPUT_DESCRIPTORS_CHANGED�_term_input_file�fileno�os�isatty�tty�setraw)�self�fd��	__class__��,/usr/share/subiquity/subiquitycore/screen.pyr
8s


�zSubiquityScreen.startcst���t�|tjj�dSr)r	�stoprrr
r�rrrrr@s
zSubiquityScreen.stop)�__name__�
__module__�__qualname__r
r�
__classcell__rrrrr$srcs4eZdZ�fdd�Z�fdd�Z�fdd�Z�ZS)�LinuxScreencs||_t�jdi|��dS)Nr)�_colorsr	�__init__�r�colors�kwargsrrrr#GszLinuxScreen.__init__cs�td�|_t�tj��t|j�|j��}t	d�D]}t	d�D]}|j
|d|||d|<qqt�|j��t|�t
���dS)N�0���)�	bytearray�curpal�fcntl�ioctl�sys�stdoutr�GIO_CMAP�copy�ranger"r�PIO_CMAPr	r
)r�newpal�i�jrrrr
Ks

 �zLinuxScreen.startcs$t�|j��t|j�t���dSr)r-r.rrr4r,r	rrrrrrUszLinuxScreen.stop)rrrr#r
rr rrrrr!Es
r!cs,eZdZ�fdd�Zdd�Zdd�Z�ZS)�TwentyFourBitScreencs.�fdd�tt�D�|_t�jdi|��dS)Ncsi|]\}}|�|d�qS)r*r)�.0r6�n�r%rr�
<dictcomp>]s�z0TwentyFourBitScreen.__init__.<locals>.<dictcomp>r)�	enumerater�_urwid_name_to_rgbr	r#r$rr;rr#\s
�zTwentyFourBitScreen.__init__cCs4|dkrdS|dkrdS|dkrdSdj|j|�S)a0Return the "SGR" parameter for selecting color.

        See https://en.wikipedia.org/wiki/ANSI_escape_code#SGR for an
        explanation.  We use the basic codes for black/white/default for
        maximum compatibility; they are the only colors used when the
        mono palette is selected.
        �white�7�black�0�default�9z8;2;{};{};{})�formatr>)r�colorrrr�_ccaszTwentyFourBitScreen._cccCsd�|�|j�|�|j��S)Nz[0;3{};4{}m)rErG�
foreground�
background)r�arrr�_attrspec_to_escapeus

�z'TwentyFourBitScreen._attrspec_to_escape)rrrr#rGrKr rrrrr8Zsr8c
Csrtdur7zt�tj��td�}Wnty)}z
t�	d|�WYd}~dSd}~wwt�	d||dk�|dkatS)N� zKDGKBTYPE failed %rFz&KDGKBTYPE returned %r, is_linux_tty %s�)
�
_is_linux_ttyr-r.r/r0r�	KDGKBTYPE�IOError�log�debug)�r�errr�is_linux_tty~s��rUFcCsN|durtj}|durtj}t�rtt||d�S|r t||d�Stt||d�S)rLN)�input�output)r/�stdinr0rUr!rrr8)�ascii�inputf�outputfrrr�make_screen�sr\)FNN)r-�loggingrr/rr�subiquitycore.paletterr�	getLoggerrQrOr1r4�UO_R�UO_G�UO_B�raw_display�Screenrr!r8rNrUr\rrrr�<module>s$

!!

Zerion Mini Shell 1.0