%PDF- %PDF-
Direktori : /lib/python3/dist-packages/Quirks/__pycache__/ |
Current File : //lib/python3/dist-packages/Quirks/__pycache__/quirkapplier.cpython-312.pyc |
� u�a� � �j � d dl m Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZ d dl Z G d� d� Zd� Zy)� )�globNc �R � e Zd Zd d�Zd� Zd� Zd� Zd� Zdd�Zd� Z d� Z d � Zd � Zd� Z y)�QuirkCheckerc � � || _ || _ g | _ | j � | j � | _ d| _ y )Nz/usr/share/X11/xorg.conf.d)�_handler�quirks_path�_quirks�get_quirks_from_path�get_system_info�_system_info�_xorg_conf_d_path)�self�handler�paths �5/usr/lib/python3/dist-packages/Quirks/quirkapplier.py�__init__zQuirkChecker.__init__! s= � ��� ��������!�!�#� �0�0�2���!=��� c � � g | _ t j j | j � r�t t j j | j d� � D ]` }t j j |� s�#t j d|z � | j |� }| xj |z c_ �b | j S t j d| j z � | j S )�5check all the files in a directory looking for quirks�*z Parsing %sz%s does not exist)r �osr �isdirr r �join�isfile�logging�debug�get_quirks_from_file)r �f�quirkss r r z!QuirkChecker.get_quirks_from_path) s� � ���� �7�7�=�=��)�)�*��"�'�'�,�,�t�'7�'7��=�>� +���7�7�>�>�!�$��M�M�,��"2�3�!�6�6�q�9�F��L�L�F�*�L� +� �|�|�� �M�M�-��0@�0@�@�A��|�|�r c �` � t j j |� }|j � S )r )�Quirks�quirkreader� ReadQuirk� get_quirks)r � quirk_files r r z!QuirkChecker.get_quirks_from_file7 s) � � �'�'�1�1�*�=� ��$�$�&�&r c �^ � t j j � }|j � S )zGet system info for the quirk)r! � quirkinfo� QuirkInfo�get_dmi_info)r � quirk_infos r r zQuirkChecker.get_system_info= s% � ��%�%�/�/�1� ��&�&�(�(r c � � d}|j j � D ]� }|j | D ]� }| j j |� s�| j j |� |k7 s�>t |j | � dk s�Zt j d| j j |� �d|��� y �� t j d� |S )zSee if tags match system infoT� zFailure to match z with F�Success)� match_tags�keysr �get�lenr r )r �quirk�result�tag�vals r �matches_tagszQuirkChecker.matches_tagsB s� � ����#�#�(�(�*� !�C��'�'��,� !���%�%�)�)�#�.�4�3D�3D�3H�3H��3M�QT�3T���(�(��-�.�!�3��M�M�#'�#4�#4�#8�#8��#=�s�#D� E� � !� !� � � �i� �� r c �: � | j D �] }| j j � |j D �cg c] }|j � j � ��" c}v s�Ut j d|j z � | j |� rj|r4t j d|j z � | j |� ��t j d|j z � | j |� ��t j d� �� yc c}w )z)Process quirks and do something with themzProcessing quirk %szApplying quirk %szUnapplying quirk %szQuirk doesn't matchN)r r �lowerr �stripr r �idr6 �info�_apply_quirk�_unapply_quirk)r �enabler2 �xs r � _check_quirkszQuirkChecker._check_quirksO s� � ��\�\� :�E��}�}�"�"�$�E�M�M�(R�q�������):�(R�R�� � �3�e�h�h�>�?��$�$�U�+�����%8�5�8�8�%C�D��)�)�%�0����%:�U�X�X�%E�F��+�+�E�2��M�M�"8�9� :��(Rs �%Dc �&